[Issue 1916] segfault on invalid string concat

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Apr 14 04:59:27 PDT 2009


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


clugdbug at yahoo.com.au changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|DUPLICATE                   |
            Summary|dmd ice on invalid string   |segfault on invalid string
                   |concat                      |concat




------- Comment #4 from clugdbug at yahoo.com.au  2009-04-14 06:59 -------
Oops, 1702 seems to be already fixed. This isn't the same.
Here's a simple patch which prevents the segfault.


Index: optimize.c
===================================================================
--- optimize.c  (revision 23)
+++ optimize.c  (working copy)
@@ -456,6 +457,8 @@
     Expression *e1old = e1;
     e1 = e1->optimize(result);
     e1 = fromConstInitializer(result, e1);
+       
+       if (!type->toBasetype()->ty) return this; // Bugzilla 1916

     if (e1 == e1old &&
        e1->op == TOKarrayliteral &&


-- 



More information about the Digitalmars-d-bugs mailing list