diff gen/llvmhelpers.cpp @ 295:895e1b50cf2a trunk

[svn r316] Fixed array slice assignments like: int[] arr = ...; arr[] = 42; There was problems with most non basic types... Added an option to premake so we can do: premake --target gnu --no-boehm to disable the Boehm GC.
author lindquist
date Mon, 23 Jun 2008 14:48:42 +0200
parents 94435b0ab2dd
children bef811104734
line wrap: on
line diff
--- a/gen/llvmhelpers.cpp	Sun Jun 22 21:36:07 2008 +0200
+++ b/gen/llvmhelpers.cpp	Mon Jun 23 14:48:42 2008 +0200
@@ -345,7 +345,7 @@
     Type* t2 = DtoDType(rhs->getType());
 
     if (t->ty == Tstruct) {
-        if (t2 != t) {
+        if (!t->equals(t2)) {
             // TODO: fix this, use 'rhs' for something
             DtoAggrZeroInit(lhs->getLVal());
         }
@@ -359,11 +359,8 @@
             if (DSliceValue* s2 = rhs->isSlice()) {
                 DtoArrayCopySlices(s, s2);
             }
-            else if (t->next == t2) {
-                if (s->len)
-                    DtoArrayInit(s->ptr, s->len, rhs->getRVal());
-                else
-                    DtoArrayInit(s->ptr, rhs->getRVal());
+            else if (t->next->equals(t2)) {
+                DtoArrayInit(s, rhs);
             }
             else {
                 DtoArrayCopyToSlice(s, rhs);
@@ -388,7 +385,7 @@
             DtoStaticArrayCopy(lhs->getLVal(), rhs->getRVal());
         }
         else {
-            DtoArrayInit(lhs->getLVal(), rhs->getRVal());
+            DtoArrayInit(lhs, rhs);
         }
     }
     else if (t->ty == Tdelegate) {