mirror of
https://github.com/cc65/cc65.git
synced 2024-12-24 11:31:31 +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;
|
||||
}
|
||||
|
||||
/* 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…
Reference in New Issue
Block a user