Only search a symbol in parent scopes if not already scoped.
This fixes the case at: https://github.com/cc65/cc65/pull/1358#issuecomment-747194906
This commit is contained in:
@@ -646,10 +646,14 @@ static void StudySymbol (ExprNode* Expr, ExprDesc* D)
|
|||||||
** about the address size, check higher lexical levels for a symbol
|
** about the address size, check higher lexical levels for a symbol
|
||||||
** with the same name and use its address size if we find such a
|
** with the same name and use its address size if we find such a
|
||||||
** symbol which is defined.
|
** symbol which is defined.
|
||||||
|
**
|
||||||
|
** Only do the search if the symbol is not in the current scope,
|
||||||
|
** assume scoped symbols can't be resolved in a different scope.
|
||||||
*/
|
*/
|
||||||
AddrSize = GetSymAddrSize (Sym);
|
AddrSize = GetSymAddrSize (Sym);
|
||||||
Parent = GetSymParentScope (Sym);
|
Parent = GetSymParentScope (Sym);
|
||||||
if (AddrSize == ADDR_SIZE_DEFAULT && Parent != 0) {
|
if (AddrSize == ADDR_SIZE_DEFAULT && Parent != 0 &&
|
||||||
|
Sym->Sym.Tab == CurrentScope) {
|
||||||
SymEntry* H = SymFindAny (Parent, GetSymName (Sym));
|
SymEntry* H = SymFindAny (Parent, GetSymName (Sym));
|
||||||
if (H) {
|
if (H) {
|
||||||
AddrSize = GetSymAddrSize (H);
|
AddrSize = GetSymAddrSize (H);
|
||||||
|
|||||||
Reference in New Issue
Block a user