Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DDMD] Issue 13182 - extern(C++) classes cause crash when allocated on the stack with scope #3797

Merged
merged 1 commit into from Jul 23, 2014

Conversation

yebblies
Copy link
Member

Destructors are not currently allowed on extern(C++) classes, so it should not call delete at all.

https://issues.dlang.org/show_bug.cgi?id=13182

@@ -2222,6 +2222,10 @@ Expression *VarDeclaration::callScopeDtor(Scope *sc)
*/
//if (cd->isInterfaceDeclaration())
//error("interface %s cannot be scope", cd->toChars());
if (cd->cpp)
{
break;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add comment explaining why.

…he stack with scope

Destructors are not currently allowed on extern(C++) classes, so it should not call delete at all.
@yebblies
Copy link
Member Author

Comment added.

@yebblies
Copy link
Member Author

Now green.

WalterBright added a commit that referenced this pull request Jul 23, 2014
[DDMD] Issue 13182 - extern(C++) classes cause crash when allocated on the stack with scope
@WalterBright WalterBright merged commit f740f0d into dlang:master Jul 23, 2014
@yebblies yebblies deleted the cppscope branch July 23, 2014 08:00
@yebblies
Copy link
Member Author

Thanks!

9rnsr pushed a commit to 9rnsr/dmd that referenced this pull request Jul 23, 2014
[DDMD] Issue 13182 - extern(C++) classes cause crash when allocated on the stack with scope
@yebblies yebblies added the DDMD label Jul 28, 2014
ibuclaw pushed a commit to ibuclaw/dmd that referenced this pull request Jul 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants