mirror of
https://github.com/cc65/cc65.git
synced 2024-12-26 08:32:00 +00:00
Fixed a problem in GetSymParentScope, where an error in the assembler input
somewhere before could lead to an invalid memory access. git-svn-id: svn://svn.cc65.org/cc65/trunk@5031 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
parent
9c267dab89
commit
9c53f8879c
@ -627,6 +627,11 @@ SymTable* GetSymParentScope (SymEntry* S)
|
||||
if ((S->Flags & SF_LOCAL) != 0) {
|
||||
/* This is a cheap local symbol */
|
||||
return 0;
|
||||
} else if (S->Sym.Tab == 0) {
|
||||
/* Symbol not in a table. This may happen if there have been errors
|
||||
* before. Return NULL in this case to avoid further errors.
|
||||
*/
|
||||
return 0;
|
||||
} else {
|
||||
/* This is a global symbol */
|
||||
return S->Sym.Tab->Parent;
|
||||
|
Loading…
Reference in New Issue
Block a user