Merged DMD commit 59c07625e84aadd2f684ea77f925ae540d5c8906:

bugzilla 4926 ICE: PREC_zero assertion failure due to unset precedence
This commit is contained in:
David Nadlinger
2011-04-22 15:03:13 +02:00
parent 55315f59ef
commit fb79515eee
3 changed files with 37 additions and 1 deletions

View File

@@ -5283,7 +5283,8 @@ Expression *AssertExp::semantic(Scope *sc)
if (e1->isBool(FALSE))
{
FuncDeclaration *fd = sc->parent->isFuncDeclaration();
fd->hasReturnExp |= 4;
if (fd)
fd->hasReturnExp |= 4;
if (!global.params.useAssert)
{ Expression *e = new HaltExp(loc);
@@ -9697,6 +9698,14 @@ RemoveExp::RemoveExp(Loc loc, Expression *e1, Expression *e2)
type = Type::tvoid;
}
void RemoveExp::toCBuffer(OutBuffer *buf, HdrGenState *hgs)
{
expToCBuffer(buf, hgs, e1, PREC_primary);
buf->writestring(".remove(");
expToCBuffer(buf, hgs, e2, PREC_assign);
buf->writestring(")");
}
/************************************************************/
CmpExp::CmpExp(enum TOK op, Loc loc, Expression *e1, Expression *e2)