AllocIf would overwrite memory if the .IF nesting became too deep.

git-svn-id: svn://svn.cc65.org/cc65/trunk@1389 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
cuz
2002-08-11 14:49:42 +00:00
parent b286cdf2b4
commit 4db7198ade
3 changed files with 6 additions and 6 deletions

View File

@@ -70,7 +70,7 @@ enum {
/* One .IF descriptor */
typedef struct IfDesc IfDesc;
struct IfDesc {
struct IfDesc {
unsigned Flags; /* Bitmapped flags, see above */
FilePos Pos; /* File position of the .IF */
const char* Name; /* Name of the directive */
@@ -89,7 +89,7 @@ static IfDesc* AllocIf (const char* Directive, int NeedTerm)
/* Check for stack overflow */
if (IfCount >= MAX_IFS) {
Error (ERR_IF_NESTING);
Fatal (FAT_IF_NESTING);
}
/* Alloc one element */