From: cuz Date: Thu, 13 Nov 2003 00:40:40 +0000 (+0000) Subject: Address size fixes X-Git-Tag: V2.12.0~1141 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=88855545e40bc95d09b5e5e8d4b94acc40a20b52;p=cc65 Address size fixes git-svn-id: svn://svn.cc65.org/cc65/trunk@2659 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- diff --git a/src/ca65/symentry.c b/src/ca65/symentry.c index f716e3288..dc56b7ba5 100644 --- a/src/ca65/symentry.c +++ b/src/ca65/symentry.c @@ -157,7 +157,12 @@ 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) { - AddrSize = SymAddrSize (S); + long Val; + if (IsConstExpr (Expr, &Val) && IsByteRange (Val)) { + AddrSize = ADDR_SIZE_ZP; + } else { + AddrSize = SymAddrSize (S); + } } /* Set the symbol value */