Temp fix for some address size problems

git-svn-id: svn://svn.cc65.org/cc65/trunk@2674 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
cuz
2003-11-18 20:50:55 +00:00
parent aa7b723b15
commit cd918a387c
4 changed files with 28 additions and 6 deletions

View File

@@ -195,8 +195,16 @@ void SymDef (SymEntry* S, ExprNode* Expr, unsigned char AddrSize, unsigned Flags
/* Map a default address size to a real value */
if (AddrSize == ADDR_SIZE_DEFAULT) {
long Val;
if (IsConstExpr (Expr, &Val) && IsByteRange (Val)) {
AddrSize = ADDR_SIZE_ZP;
if (IsConstExpr (Expr, &Val)) {
if (IsByteRange (Val)) {
AddrSize = ADDR_SIZE_ZP;
} else if (IsWordRange (Val)) {
AddrSize = ADDR_SIZE_ABS;
} else if (IsFarRange (Val)) {
AddrSize = ADDR_SIZE_FAR;
} else {
AddrSize = ADDR_SIZE_LONG;
}
} else {
AddrSize = SymAddrSize (S);
}