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

Assertion failed: (irfunction->thisArg), function DtoCreateNestedContext, file ldc/gen/nested.cpp, line 433 #447

Closed
timotheecour opened this issue Aug 19, 2013 · 3 comments · Fixed by #456

Comments

@timotheecour
Copy link

import std.algorithm;

void test(){
    bool c;
    bool fun1(int b){   return c;   }
    int[] x;
    x.filter!fun1;

    bool[] dirs;
    dirs.filter!(a=>{return a; }());
}
$ldmd_X -c main.d
Assertion failed: (irfunction->thisArg), function DtoCreateNestedContext, file ldc/gen/nested.cpp, line 433.
0  ldc2              0x000000010aa7c170 PrintStackTrace(void*) + 34
1  ldc2              0x000000010aa7c502 SignalHandler(int) + 228
2  libsystem_c.dylib 0x00007fff98b4594a _sigtramp + 26
3  libsystem_c.dylib 0x000000010b126000 _sigtramp + 18446603342434928336
4  ldc2              0x000000010aa7c385 abort + 22
5  ldc2              0x000000010aa7c353 __assert_rtn + 53
6  ldc2              0x000000010a3d3f0b DtoCreateNestedContext(FuncDeclaration*) + 219
7  ldc2              0x000000010a3c1b85 DtoDefineFunction(FuncDeclaration*) + 2117
8  ldc2              0x000000010a40a36b Ir::emitFunctionBodies() + 95
9  ldc2              0x000000010a3cf5d4 Module::genLLVMModule(llvm::LLVMContext&, Ir*) + 850
10 ldc2              0x000000010a2af74e main + 9278
11 libdyld.dylib     0x00007fff912ce7e1 start + 0
Error: Error executing ldc2: Illegal instruction: 4
@redstar
Copy link
Member

redstar commented Aug 19, 2013

Thanks for the report. It crashes here, too.

@dnadlinger
Copy link
Member

(replaced --- with three backticks in the report so it renders properly on GitHub)

dnadlinger added a commit to dnadlinger/ldc that referenced this issue Aug 31, 2013
They can be demoted to function literals without being static.

GitHub: Fixes ldc-developers#447.
dnadlinger added a commit to dnadlinger/ldc that referenced this issue Sep 12, 2013
@dnadlinger
Copy link
Member

Committed a fix; still need to add a reduced (i.e. not dependent on Phobos) test case to the test suite.

redstar pushed a commit that referenced this issue Sep 27, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants