diff gen/statements.cpp @ 201:8f9191180c7a trunk

[svn r217] Updated: the rebuild profiles. Fixed: way to find class data fields was too strict type wise. Fixed: foreach resulting in an implicit delegate could fail.
author lindquist
date Mon, 12 May 2008 22:44:25 +0200
parents e937752e4541
children 9d44ec83acd1
line wrap: on
line diff
--- a/gen/statements.cpp	Mon May 12 22:27:05 2008 +0200
+++ b/gen/statements.cpp	Mon May 12 22:44:25 2008 +0200
@@ -842,12 +842,13 @@
     llvm::Value* zerokey = llvm::ConstantInt::get(keytype,0,false);
 
     // value
+    Logger::println("value = %s", value->toPrettyChars());
     const llvm::Type* valtype = DtoType(value->type);
     llvm::Value* valvar = NULL;
     if (!value->isRef() && !value->isOut())
         valvar = new llvm::AllocaInst(valtype, "foreachval", p->topallocapoint());
-    assert(!value->ir.irLocal);
-    value->ir.irLocal = new IrLocal(value);
+    if (!value->ir.irLocal)
+        value->ir.irLocal = new IrLocal(value);
 
     // what to iterate
     DValue* aggrval = aggr->toElem(p);