Fixed a bug

git-svn-id: svn://svn.cc65.org/cc65/trunk@1922 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
cuz
2003-02-02 21:05:39 +00:00
parent 4fe0f3ae3c
commit c5868d30c0

View File

@@ -2156,8 +2156,16 @@ static void parseadd (int k, ExprDesc* lval)
flags = CF_PTR;
lval->Type = lval2.Type;
} else if (IsClassInt (lhst) && IsClassInt (rhst)) {
/* Integer addition */
flags = typeadjust (lval, &lval2, 0);
/* Integer addition. Note: Result is never constant.
* Problem here is that typeadjust does not know if the
* variable is an rvalue or lvalue, so if both operands
* are dereferenced constant numeric addresses, typeadjust
* thinks the operation works on constants. Removing
* CF_CONST here means handling the symptoms, however, the
* whole parser is such a mess that I fear to break anything
* when trying to apply another solution.
*/
flags = typeadjust (lval, &lval2, 0) & ~CF_CONST;
} else {
/* OOPS */
Error ("Invalid operands for binary operator `+'");