From 9c53f8879c926b2d3ebdccd98b83906a09f51361 Mon Sep 17 00:00:00 2001 From: uz Date: Tue, 31 May 2011 14:51:21 +0000 Subject: [PATCH] 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 --- src/ca65/symentry.c | 5 +++++ 1 file changed, 5 insertions(+) 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; -- 2.39.5