Thread overview
[Issue 1916] New: dmd ice on invalid string concat
Mar 13, 2008
d-bugmail
Apr 17, 2008
d-bugmail
Apr 01, 2009
d-bugmail
Apr 14, 2009
d-bugmail
[Issue 1916] segfault on invalid string concat
Apr 14, 2009
d-bugmail
May 14, 2009
Don
May 14, 2009
Don
March 13, 2008
http://d.puremagic.com/issues/show_bug.cgi?id=1916

           Summary: dmd ice on invalid string concat
           Product: D
           Version: 2.012
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Keywords: ice-on-invalid-code
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla@digitalmars.com
        ReportedBy: spam@extrawurst.org


this invalid piece of code crashes the dmd compiler.

[CODE]
void main() {
        string crash = 01 ~ " foo?";
}
[/CODE]


-- 

April 17, 2008
http://d.puremagic.com/issues/show_bug.cgi?id=1916





------- Comment #1 from gide@nwawudu.com  2008-04-17 07:26 -------
This looks similar to a BUG 1702 which did get fixed, a later release appears to have re-introduced it.


-- 

April 01, 2009
http://d.puremagic.com/issues/show_bug.cgi?id=1916





------- Comment #2 from clugdbug@yahoo.com.au  2009-04-01 07:57 -------
Only segfaults on D2.

fog.d(2): Error: incompatible types for ((1) ~ (" foo?")): 'int' and
'immutable(
char)[]'
fog.d(2): Error: Can only concatenate arrays, not (int ~ immutable(char)[])
fog.d(2): Error: cannot implicitly convert expression ("\x01 foo?") of type int
to immutable(char)[]
[SEGFAULT]


-- 

April 14, 2009
http://d.puremagic.com/issues/show_bug.cgi?id=1916


clugdbug@yahoo.com.au changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
           Keywords|                            |patch
         Resolution|                            |DUPLICATE




------- Comment #3 from clugdbug@yahoo.com.au  2009-04-14 04:57 -------
This is indeed the same as bug 1702. A patch to fix this one also fixed 1702.

*** This bug has been marked as a duplicate of 1702 ***


-- 

April 14, 2009
http://d.puremagic.com/issues/show_bug.cgi?id=1916


clugdbug@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@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 &&


-- 

May 14, 2009
http://d.puremagic.com/issues/show_bug.cgi?id=1916


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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |clugdbug@yahoo.com.au




--- Comment #5 from Don <clugdbug@yahoo.com.au>  2009-05-14 06:56:12 PDT ---
Fixed DMD2.030 and 1.045.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
May 14, 2009
http://d.puremagic.com/issues/show_bug.cgi?id=1916


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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |RESOLVED
         Resolution|                            |FIXED




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