Bugfix
git-svn-id: svn://svn.cc65.org/cc65/trunk@757 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
@@ -226,7 +226,7 @@ unsigned assignadjust (type* lhst, struct expent* rhs)
|
|||||||
* as const.
|
* as const.
|
||||||
*/
|
*/
|
||||||
unsigned flags = TypeOf (rhst);
|
unsigned flags = TypeOf (rhst);
|
||||||
if (rhs->e_flags & E_MCONST) {
|
if (rhs->e_flags == E_MCONST) {
|
||||||
flags |= CF_CONST;
|
flags |= CF_CONST;
|
||||||
}
|
}
|
||||||
return g_typeadjust (TypeOf (lhst) | CF_CONST, flags);
|
return g_typeadjust (TypeOf (lhst) | CF_CONST, flags);
|
||||||
@@ -257,7 +257,7 @@ unsigned assignadjust (type* lhst, struct expent* rhs)
|
|||||||
}
|
}
|
||||||
} else if (IsClassInt (rhst)) {
|
} else if (IsClassInt (rhst)) {
|
||||||
/* Int to pointer assignment is valid only for constant zero */
|
/* Int to pointer assignment is valid only for constant zero */
|
||||||
if ((rhs->e_flags & E_MCONST) == 0 || rhs->e_const != 0) {
|
if (rhs->e_flags != E_MCONST || rhs->e_const != 0) {
|
||||||
Warning ("Converting integer to pointer without a cast");
|
Warning ("Converting integer to pointer without a cast");
|
||||||
}
|
}
|
||||||
} else if (IsTypeFuncPtr (lhst) && IsTypeFunc(rhst)) {
|
} else if (IsTypeFuncPtr (lhst) && IsTypeFunc(rhst)) {
|
||||||
@@ -1483,10 +1483,10 @@ static void unaryop (int tok, struct expent* lval)
|
|||||||
|
|
||||||
NextToken ();
|
NextToken ();
|
||||||
k = hie10 (lval);
|
k = hie10 (lval);
|
||||||
if (k == 0 && lval->e_flags & E_MCONST) {
|
if (k == 0 && lval->e_flags == E_MCONST) {
|
||||||
/* Value is constant */
|
/* Value is constant */
|
||||||
switch (tok) {
|
switch (tok) {
|
||||||
case TOK_MINUS: lval->e_const = -lval->e_const; break;
|
case TOK_MINUS: lval->e_const = -lval->e_const; break;
|
||||||
case TOK_PLUS: break;
|
case TOK_PLUS: break;
|
||||||
case TOK_COMP: lval->e_const = ~lval->e_const; break;
|
case TOK_COMP: lval->e_const = ~lval->e_const; break;
|
||||||
default: Internal ("Unexpected token: %d", tok);
|
default: Internal ("Unexpected token: %d", tok);
|
||||||
@@ -2170,7 +2170,7 @@ static void parsesub (int k, struct expent* lval)
|
|||||||
rhst = lval2.e_tptr;
|
rhst = lval2.e_tptr;
|
||||||
|
|
||||||
/* Check left hand side */
|
/* Check left hand side */
|
||||||
if (k == 0 && lval->e_flags & E_MCONST) {
|
if (k == 0 && lval->e_flags == E_MCONST) {
|
||||||
|
|
||||||
/* Both sides are constant, remove generated code */
|
/* Both sides are constant, remove generated code */
|
||||||
RemoveCode (Mark1);
|
RemoveCode (Mark1);
|
||||||
@@ -2832,7 +2832,7 @@ static void Assignment (struct expent* lval)
|
|||||||
|
|
||||||
/* cc65 does not have full support for handling structs by value. Since
|
/* cc65 does not have full support for handling structs by value. Since
|
||||||
* assigning structs is one of the more useful operations from this
|
* assigning structs is one of the more useful operations from this
|
||||||
* familiy, allow it here.
|
* family, allow it here.
|
||||||
*/
|
*/
|
||||||
if (IsClassStruct (ltype)) {
|
if (IsClassStruct (ltype)) {
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user