changeset 773:5696a7167b21

Fix RawVarDecl double codegen bug. Thanks to downs for the testcase.
author Christian Kamm <kamm incasoftware de>
date Tue, 18 Nov 2008 18:07:57 +0100
parents cd7da2ba14d1
children 9688da40cd4d
files gen/llvmhelpers.cpp tests/mini/compile_rawvardeclinfinally.d
diffstat 2 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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
--- /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(); } }