mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-02-26 00:23:14 +01:00
Merged DMD commit fe063f92ec667d0a8d4e2ab4659919df4360d7e8:
bugzilla 4864 ICE(statement.c) Crash on invalid 'if statement' body inside mixin
This commit is contained in:
@@ -3181,7 +3181,10 @@ Statement *Parser::parseStatement(int flags)
|
||||
}
|
||||
else
|
||||
elsebody = NULL;
|
||||
s = new IfStatement(loc, arg, condition, ifbody, elsebody);
|
||||
if (condition && ifbody)
|
||||
s = new IfStatement(loc, arg, condition, ifbody, elsebody);
|
||||
else
|
||||
s = NULL; // don't propagate parsing errors
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -339,7 +339,8 @@ Statements *CompileStatement::flatten(Scope *sc)
|
||||
while (p.token.value != TOKeof)
|
||||
{
|
||||
Statement *s = p.parseStatement(PSsemi | PScurlyscope);
|
||||
a->push(s);
|
||||
if (s) // if no parsing errors
|
||||
a->push(s);
|
||||
}
|
||||
return a;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user