[Issue 3668] foreach over typedef'd array crashes dmd

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Jan 4 07:24:59 PST 2010


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


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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |patch
                 CC|                            |clugdbug at yahoo.com.au


--- Comment #1 from Don <clugdbug at yahoo.com.au> 2010-01-04 07:24:58 PST ---
There's a missing toBaseType() in the Foreach code which was introduced in
D2.032.

PATCH:
statement.c, line 1525, in ForeachStatement::semantic():
------
        Identifier *id = Lexer::uniqueId("__aggr");
        ExpInitializer *ie = new ExpInitializer(loc, new SliceExp(loc, aggr,
NULL, NULL));
-        VarDeclaration *tmp = new VarDeclaration(loc,
aggr->type->nextOf()->arrayOf(), id, ie);
+        VarDeclaration *tmp = new VarDeclaration(loc,
aggr->type->toBasetype()->nextOf()->arrayOf(), id, ie);

        Expression *tmp_length = new DotIdExp(loc, new VarExp(loc, tmp),
Id::length);

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


More information about the Digitalmars-d-bugs mailing list