mirror of
https://github.com/cc65/cc65.git
synced 2025-01-12 17:30:50 +00:00
Fixed a bug: The op= operators (+=, -=, etc.) worked on const qualified
objects. git-svn-id: svn://svn.cc65.org/cc65/trunk@3883 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
parent
66b3f9d974
commit
1e672a3169
@ -2777,6 +2777,11 @@ static void opeq (const GenDesc* Gen, ExprDesc* Expr)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* The left side must not be const qualified */
|
||||||
|
if (IsQualConst (Expr->Type)) {
|
||||||
|
Error ("Assignment to const");
|
||||||
|
}
|
||||||
|
|
||||||
/* There must be an integer or pointer on the left side */
|
/* There must be an integer or pointer on the left side */
|
||||||
if (!IsClassInt (Expr->Type) && !IsTypePtr (Expr->Type)) {
|
if (!IsClassInt (Expr->Type) && !IsTypePtr (Expr->Type)) {
|
||||||
Error ("Invalid left operand type");
|
Error ("Invalid left operand type");
|
||||||
@ -2875,6 +2880,11 @@ static void addsubeq (const GenDesc* Gen, ExprDesc *Expr)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* The left side must not be const qualified */
|
||||||
|
if (IsQualConst (Expr->Type)) {
|
||||||
|
Error ("Assignment to const");
|
||||||
|
}
|
||||||
|
|
||||||
/* There must be an integer or pointer on the left side */
|
/* There must be an integer or pointer on the left side */
|
||||||
if (!IsClassInt (Expr->Type) && !IsTypePtr (Expr->Type)) {
|
if (!IsClassInt (Expr->Type) && !IsTypePtr (Expr->Type)) {
|
||||||
Error ("Invalid left operand type");
|
Error ("Invalid left operand type");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user