mirror of
https://github.com/cc65/cc65.git
synced 2025-01-11 11:30:13 +00:00
E_ADDRESS_OF logic fix.
This commit is contained in:
parent
9e82de4607
commit
80a468f8bd
@ -93,8 +93,7 @@ int ED_IsLocPrimaryOrExpr (const ExprDesc* Expr)
|
|||||||
int ED_IsIndExpr (const ExprDesc* Expr)
|
int ED_IsIndExpr (const ExprDesc* Expr)
|
||||||
/* Check if the expression is a reference to its value */
|
/* Check if the expression is a reference to its value */
|
||||||
{
|
{
|
||||||
return (Expr->Flags & E_ADDRESS_OF) == 0 &&
|
return (Expr->Flags & E_ADDRESS_OF) == 0 && !ED_IsLocNone (Expr);
|
||||||
!ED_IsLocNone (Expr) && !ED_IsLocPrimary (Expr);
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -282,7 +281,7 @@ ExprDesc* ED_AddrExpr (ExprDesc* Expr)
|
|||||||
|
|
||||||
case E_LOC_EXPR:
|
case E_LOC_EXPR:
|
||||||
Expr->Flags &= ~(E_MASK_LOC | E_MASK_RTYPE);
|
Expr->Flags &= ~(E_MASK_LOC | E_MASK_RTYPE);
|
||||||
Expr->Flags |= E_LOC_PRIMARY | E_RTYPE_RVAL;
|
Expr->Flags |= E_ADDRESS_OF | E_LOC_PRIMARY | E_RTYPE_RVAL;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
@ -493,8 +493,7 @@ INLINE int ED_IsAddrExpr (const ExprDesc* Expr)
|
|||||||
INLINE int ED_IsIndExpr (const ExprDesc* Expr)
|
INLINE int ED_IsIndExpr (const ExprDesc* Expr)
|
||||||
/* Check if the expression is a reference to its value */
|
/* Check if the expression is a reference to its value */
|
||||||
{
|
{
|
||||||
return (Expr->Flags & E_ADDRESS_OF) == 0 &&
|
return (Expr->Flags & E_ADDRESS_OF) == 0 && !ED_IsLocNone (Expr);
|
||||||
!ED_IsLocNone (Expr) && !ED_IsLocPrimary (Expr);
|
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
int ED_IsIndExpr (const ExprDesc* Expr);
|
int ED_IsIndExpr (const ExprDesc* Expr);
|
||||||
|
@ -92,6 +92,7 @@ static void LoadAddress (unsigned Flags, ExprDesc* Expr)
|
|||||||
g_leasp (Expr->IVal);
|
g_leasp (Expr->IVal);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case E_LOC_PRIMARY:
|
||||||
case E_LOC_EXPR:
|
case E_LOC_EXPR:
|
||||||
if (Expr->IVal != 0) {
|
if (Expr->IVal != 0) {
|
||||||
/* We have an expression in the primary plus a constant
|
/* We have an expression in the primary plus a constant
|
||||||
|
Loading…
x
Reference in New Issue
Block a user