From 88855545e40bc95d09b5e5e8d4b94acc40a20b52 Mon Sep 17 00:00:00 2001 From: cuz Date: Thu, 13 Nov 2003 00:40:40 +0000 Subject: [PATCH] Address size fixes git-svn-id: svn://svn.cc65.org/cc65/trunk@2659 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- src/ca65/symentry.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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 */ -- 2.39.5