diff gen/tollvm.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 aca17e55b7a5
children e881c9b1c738
line wrap: on
line diff
--- a/gen/tollvm.cpp	Mon May 12 22:27:05 2008 +0200
+++ b/gen/tollvm.cpp	Mon May 12 22:44:25 2008 +0200
@@ -1006,11 +1006,16 @@
         Logger::cout() << "assign\nlhs: " << *l << "rhs: " << *r << '\n';
         const llvm::Type* lit = l->getType()->getContainedType(0);
         if (r->getType() != lit) {
-            if (DLRValue* lr = lhs->isLRValue()) // handle lvalue cast assignments
+            // handle lvalue cast assignments
+            if (DLRValue* lr = lhs->isLRValue()) {
+                Logger::println("lvalue cast!");
                 r = DtoCast(rhs, lr->getLType())->getRVal();
-            else
+            }
+            else {
                 r = DtoCast(rhs, lhs->getType())->getRVal();
+            }
             Logger::cout() << "really assign\nlhs: " << *l << "rhs: " << *r << '\n';
+            assert(r->getType() == l->getType()->getContainedType(0));
         }
         gIR->ir->CreateStore(r, l);
     }