-
-
Notifications
You must be signed in to change notification settings - Fork 262
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
LDC emits wrong code #2960
Comments
Ignore that, my command line was completely wrong. |
With this amendment, it should behave more consistently, I think: void main()
{
int magic = 0xDEADBEEF;
listDir!(() { assert(magic == 0xDEADBEEF); })();
} |
Now I get
Will take a look. |
Somewhat reduced, showing that there must be some confusion wrt. local frame and context for the template listDir(alias handler)
{
struct Context
{
void callHandler() { handler(); }
}
void listDir()
{
int a = 123;
void blub() { assert(a == 123); } // working if commented out
Context().callHandler();
}
}
void main()
{
int s = 0xDEADBEEF;
listDir!(() { assert(s == 0xDEADBEEF); })();
} |
template listDir(alias handler)
{
void test() { handler(); }
void listDir()
{
int a = 123;
void blub() { assert(a == 123); }
blub();
test();
}
}
void main()
{
int s = 0xDEADBEEF;
listDir!(() { assert(s == 0xDEADBEEF); })();
} |
The context for instances of aggregates *not* nested in the current function, but some parent. Fixes ldc-developers#2960.
The context for instances of aggregates *not* nested in the current function, but some parent. Fixes ldc-developers#2960.
Thx for the nice reduced testcase; fixed by #2969. |
The context for instances of aggregates *not* nested in the current function, but some parent. Fixes #2960.
Very belated thank you :) |
Hello,
This program
segfaultscrashes with "Memory allocation failed" (attempts to append to array at wrong memory address) when built with LDC, but runs fine when built with DMD:I'm using LDC as packaged in Arch Linux:
The text was updated successfully, but these errors were encountered: