ldc-developers/ldc — Issue #69: LDC1 from master fails to build Tango
Author: klickverbot
Created: 2012-01-23 20:15:11+00:00
State: open

Commit 988906742000ddace7e62b95ccd7d58431758d3d broke the D1 compiler, it asserts while building Tango. Reduced test case:

```d
class GC {
static void locked(in void delegate() code) {}
struct WeakPointer {
Object reference;
void ondestroy(Object r) {
locked({ reference = null; });
}
}
}
```

```
Assertion failed: (!vd->ir.irLocal->byref), function DtoCreateNestedContext, file /Users/aule/Documents/code/projects/ldc/gen/nested.cpp, line 683.
0 ldc 0x000000010dc1ef35 _ZL15PrintStackTracePv + 53
1 ldc 0x000000010dc1f5a9 _ZL13SignalHandleri + 361
2 libsystem_c.dylib 0x00007fff8b44ccfa _sigtramp + 26
3 libsystem_c.dylib 0x000004000ce58458 _sigtramp + 18446607736442500984
4 ldc 0x000000010dc1f27b raise + 27
5 ldc 0x000000010dc1f33c abort + 28
6 ldc 0x000000010dc1f311 __assert_rtn + 129
7 ldc 0x000000010ced1ab2 DtoCreateNestedContext(FuncDeclaration*) + 4610
8 ldc 0x000000010ce9d28a DtoDefineFunction(FuncDeclaration*) + 4522
9 ldc 0x000000010cf46ced Ir::emitFunctionBodies() + 87
10 ldc 0x000000010cf3dc5f Module::genLLVMModule(llvm::LLVMContext&, Ir*) + 1517
11 ldc 0x000000010cec3858 main + 16408
12 ldc 0x000000010ccf9e34 start + 52
13 ldc 0x0000000000000003 start + 18446744069199651331
```