1
0
mirror of https://github.com/cc65/cc65.git synced 2024-09-27 04:54:54 +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:
uz 2008-08-07 22:22:58 +00:00
parent 66b3f9d974
commit 1e672a3169

View File

@ -2777,6 +2777,11 @@ static void opeq (const GenDesc* Gen, ExprDesc* Expr)
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 */
if (!IsClassInt (Expr->Type) && !IsTypePtr (Expr->Type)) {
Error ("Invalid left operand type");
@ -2875,6 +2880,11 @@ static void addsubeq (const GenDesc* Gen, ExprDesc *Expr)
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 */
if (!IsClassInt (Expr->Type) && !IsTypePtr (Expr->Type)) {
Error ("Invalid left operand type");