Fixed wrong code generation for
((unsigned char *)(&shadow))[reg & 0x0f] = value; git-svn-id: svn://svn.cc65.org/cc65/trunk@3875 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
@@ -979,6 +979,7 @@ static void ArrayRef (ExprDesc* Expr)
|
|||||||
g_addstatic (Flags, SubScript.Name, SubScript.IVal);
|
g_addstatic (Flags, SubScript.Name, SubScript.IVal);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
if (ED_IsLocAbs (Expr)) {
|
if (ED_IsLocAbs (Expr)) {
|
||||||
/* Constant numeric address. Just add it */
|
/* Constant numeric address. Just add it */
|
||||||
g_inc (CF_INT, Expr->IVal);
|
g_inc (CF_INT, Expr->IVal);
|
||||||
@@ -992,9 +993,11 @@ static void ArrayRef (ExprDesc* Expr)
|
|||||||
} else {
|
} else {
|
||||||
/* Base address is a static variable address */
|
/* Base address is a static variable address */
|
||||||
unsigned Flags = CF_INT | GlobalModeFlags (Expr->Flags);
|
unsigned Flags = CF_INT | GlobalModeFlags (Expr->Flags);
|
||||||
if (IsTypeArray (Expr->Type)) {
|
if (ED_IsRVal (Expr)) {
|
||||||
|
/* Add the address of the location */
|
||||||
g_addaddr_static (Flags, Expr->Name, Expr->IVal);
|
g_addaddr_static (Flags, Expr->Name, Expr->IVal);
|
||||||
} else {
|
} else {
|
||||||
|
/* Add the contents of the location */
|
||||||
g_addstatic (Flags, Expr->Name, Expr->IVal);
|
g_addstatic (Flags, Expr->Name, Expr->IVal);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user