Merged DMD commit 3803c7bdc266b45c102a9c5dd33bc788994dc3ea:

bugzilla 5180 ICE(arrayop.c) in-place array operation on incompatible types
This commit is contained in:
David Nadlinger
2011-04-22 18:33:35 +02:00
parent 631453d41b
commit 90c2240d6b

View File

@@ -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);
}