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:
@@ -627,6 +627,11 @@ SymTable* GetSymParentScope (SymEntry* S)
|
|||||||
if ((S->Flags & SF_LOCAL) != 0) {
|
if ((S->Flags & SF_LOCAL) != 0) {
|
||||||
/* This is a cheap local symbol */
|
/* This is a cheap local symbol */
|
||||||
return 0;
|
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 {
|
} else {
|
||||||
/* This is a global symbol */
|
/* This is a global symbol */
|
||||||
return S->Sym.Tab->Parent;
|
return S->Sym.Tab->Parent;
|
||||||
|
|||||||
Reference in New Issue
Block a user