mirror of
https://github.com/cc65/cc65.git
synced 2025-08-08 22:25:28 +00:00
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);
|
||||
}
|
||||
} else {
|
||||
|
||||
if (ED_IsLocAbs (Expr)) {
|
||||
/* Constant numeric address. Just add it */
|
||||
g_inc (CF_INT, Expr->IVal);
|
||||
@@ -992,9 +993,11 @@ static void ArrayRef (ExprDesc* Expr)
|
||||
} else {
|
||||
/* Base address is a static variable address */
|
||||
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);
|
||||
} else {
|
||||
/* Add the contents of the location */
|
||||
g_addstatic (Flags, Expr->Name, Expr->IVal);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user