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
1 changed files with 10 additions and 0 deletions
|
@ -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");
|
||||
|
|
Loading…
Add table
Reference in a new issue