1
0
mirror of https://github.com/cc65/cc65.git synced 2024-11-13 13:11:06 +00:00

Temp fix for address size detection of symbols

git-svn-id: svn://svn.cc65.org/cc65/trunk@2701 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
cuz 2003-11-30 22:54:13 +00:00
parent 9ebc3d1f01
commit 3a7c054f6b

View File

@ -46,6 +46,7 @@
#include "scanner.h"
#include "segment.h"
#include "spool.h"
#include "studyexpr.h" /* ### */
#include "symentry.h"
#include "symtab.h"
@ -87,20 +88,6 @@ int IsLocalNameId (unsigned Name)
static unsigned SymAddrSize (const SymEntry* S)
/* Get the default address size for a symbol. */
{
/* Local symbols are always near (is this ok?) */
if (IsLocalNameId (S->Name)) {
return ADDR_SIZE_ABS;
}
/* Return the address size of the segment */
return GetCurrentSegAddrSize ();
}
SymEntry* NewSymEntry (const char* Name)
/* Allocate a symbol table entry, initialize and return it */
{
@ -220,20 +207,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) {
long Val;
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);
}
/* ### Must go! Delay address size calculation until end of assembly! */
ExprDesc ED;
ED_Init (&ED);
StudyExpr (Expr, &ED);
AddrSize = ED.AddrSize;
ED_Done (&ED);
}
/* Set the symbol value */