http://d.puremagic.com/issues/show_bug.cgi?id=3357


Don <clugd...@yahoo.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |patch
            Summary|ICE with aa that use static |ICE(cod1.c) using 'in' with
                   |char array as key           |a static char array as AA
                   |                            |key


--- Comment #5 from Don <clugd...@yahoo.com.au> 2009-10-06 00:26:37 PDT ---
Same cause as bug 1934. The patch I used for IndexExp::toElem() also needs to 
be applied to InExp::toElem().

Index: e2ir.c
===================================================================
--- e2ir.c    (revision 75)
+++ e2ir.c    (working copy)
@@ -2391,6 +2391,13 @@
     key->Enumbytes = key->E1->Enumbytes;
     assert(key->Enumbytes);
     }
+    else if (tybasic(key->Ety) == TYarray && taa->index->ty==Tsarray)
+    {    // e2->elem() turns string literals into a TYarray, so the
+    // length is lost. Restore it.
+    key = el_una(OPstrpar, TYstruct, key);
+    assert(e1->type->size() == taa->index->size());
+    key->Enumbytes = taa->index->size();
+    }

     Symbol *s = taa->aaGetSymbol("In", 0);
     keyti = taa->index->getInternalTypeInfo(NULL)->toElem(irs);

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------

Reply via email to