# HG changeset patch # User Christian Kamm # Date 1227028077 -3600 # Node ID 5696a7167b21fb005365e1126851f29c03409fa6 # Parent cd7da2ba14d1efc6b63b268198d37bbde43a4cad Fix RawVarDecl double codegen bug. Thanks to downs for the testcase. diff -r cd7da2ba14d1 -r 5696a7167b21 gen/llvmhelpers.cpp --- a/gen/llvmhelpers.cpp Tue Nov 18 17:14:57 2008 +0100 +++ b/gen/llvmhelpers.cpp Tue Nov 18 18:07:57 2008 +0100 @@ -1332,6 +1332,10 @@ // 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 diff -r cd7da2ba14d1 -r 5696a7167b21 tests/mini/compile_rawvardeclinfinally.d --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/mini/compile_rawvardeclinfinally.d Tue Nov 18 18:07:57 2008 +0100 @@ -0,0 +1,1 @@ +void foo() { void delegate()[] bar; try {} finally { foreach (dg; bar) dg(); } }