Fix RawVarDecl double codegen bug. Thanks to downs for the testcase.

This commit is contained in:
Christian Kamm 2008-11-18 18:07:57 +01:00
parent ccd8810e68
commit b172c4a668
2 changed files with 5 additions and 0 deletions

View file

@ -1332,6 +1332,10 @@ LLValue* DtoRawVarDeclaration(VarDeclaration* var)
// we don't handle aliases either
assert(!var->aliassym);
// if this already has storage, it must've been handled already
if (var->ir.irLocal && var->ir.irLocal->value)
return var->ir.irLocal->value;
// referenced by nested function?
#if DMDV2

View file

@ -0,0 +1 @@
void foo() { void delegate()[] bar; try {} finally { foreach (dg; bar) dg(); } }