From 90c2240d6b77d7ec93d519c778a6b7a666de1919 Mon Sep 17 00:00:00 2001 From: David Nadlinger Date: Fri, 22 Apr 2011 18:33:35 +0200 Subject: [PATCH] Merged DMD commit 3803c7bdc266b45c102a9c5dd33bc788994dc3ea: bugzilla 5180 ICE(arrayop.c) in-place array operation on incompatible types --- dmd/expression.c | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/dmd/expression.c b/dmd/expression.c index 61555d1f..b485f551 100644 --- a/dmd/expression.c +++ b/dmd/expression.c @@ -4988,7 +4988,9 @@ Expression *BinExp::commonSemanticAssign(Scope *sc) if (e1->op == TOKslice) { // T[] op= ... - typeCombine(sc); + e = typeCombine(sc); + if (e->op == TOKerror) + return e; type = e1->type; return arrayOp(sc); } @@ -5026,7 +5028,9 @@ Expression *BinExp::commonSemanticAssignIntegral(Scope *sc) if (e1->op == TOKslice) { // T[] op= ... - typeCombine(sc); + e = typeCombine(sc); + if (e->op == TOKerror) + return e; type = e1->type; return arrayOp(sc); } @@ -8386,7 +8390,9 @@ Expression *AddAssignExp::semantic(Scope *sc) if (e1->op == TOKslice) { - typeCombine(sc); + e = typeCombine(sc); + if (e->op == TOKerror) + return e; type = e1->type; return arrayOp(sc); } @@ -8492,7 +8498,9 @@ Expression *MinAssignExp::semantic(Scope *sc) if (e1->op == TOKslice) { // T[] -= ... - typeCombine(sc); + e = typeCombine(sc); + if (e->op == TOKerror) + return e; type = e1->type; return arrayOp(sc); } @@ -8630,7 +8638,9 @@ Expression *MulAssignExp::semantic(Scope *sc) if (e1->op == TOKslice) { // T[] -= ... - typeCombine(sc); + e = typeCombine(sc); + if (e->op == TOKerror) + return e; type = e1->type; return arrayOp(sc); } @@ -8706,7 +8716,9 @@ Expression *DivAssignExp::semantic(Scope *sc) if (e1->op == TOKslice) { // T[] -= ... - typeCombine(sc); + e = typeCombine(sc); + if (e->op == TOKerror) + return e; type = e1->type; return arrayOp(sc); }