From: uz Date: Tue, 31 May 2011 14:51:21 +0000 (+0000) Subject: Fixed a problem in GetSymParentScope, where an error in the assembler input X-Git-Tag: V2.13.3~429 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=9c53f8879c926b2d3ebdccd98b83906a09f51361;p=cc65 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 --- diff --git a/src/ca65/symentry.c b/src/ca65/symentry.c index 999ae32f8..763820731 100644 --- a/src/ca65/symentry.c +++ b/src/ca65/symentry.c @@ -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;