mirror of
https://github.com/cc65/cc65.git
synced 2025-01-03 16:33:19 +00:00
Fixed a bug: .ENDPROC without .PROC would crash the assembler
git-svn-id: svn://svn.cc65.org/cc65/trunk@2027 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
parent
53518d59c9
commit
7d350d3f61
@ -6,10 +6,10 @@
|
||||
/* */
|
||||
/* */
|
||||
/* */
|
||||
/* (C) 1998-2002 Ullrich von Bassewitz */
|
||||
/* Wacholderweg 14 */
|
||||
/* D-70597 Stuttgart */
|
||||
/* EMail: uz@musoftware.de */
|
||||
/* (C) 1998-2003 Ullrich von Bassewitz */
|
||||
/* Römerstrasse 52 */
|
||||
/* D-70794 Filderstadt */
|
||||
/* EMail: uz@cc65.org */
|
||||
/* */
|
||||
/* */
|
||||
/* This software is provided 'as-is', without any expressed or implied */
|
||||
@ -183,6 +183,7 @@ void ErrorMsg (const FilePos* Pos, unsigned ErrNum, va_list ap)
|
||||
"Duplicate `.ELSE'",
|
||||
"Conditional assembly branch was never closed",
|
||||
"Lexical level was not terminated correctly",
|
||||
"No open lexical level",
|
||||
"Segment attribute mismatch",
|
||||
"Segment stack overflow",
|
||||
"Segment stack is empty",
|
||||
@ -190,7 +191,7 @@ void ErrorMsg (const FilePos* Pos, unsigned ErrNum, va_list ap)
|
||||
"CPU not supported",
|
||||
"Counter underflow",
|
||||
"Undefined label",
|
||||
"Open `%s´",
|
||||
"Open `%s'",
|
||||
"File name `%s' not found in file table",
|
||||
};
|
||||
|
||||
|
@ -6,10 +6,10 @@
|
||||
/* */
|
||||
/* */
|
||||
/* */
|
||||
/* (C) 1998-2002 Ullrich von Bassewitz */
|
||||
/* Wacholderweg 14 */
|
||||
/* D-70597 Stuttgart */
|
||||
/* EMail: uz@musoftware.de */
|
||||
/* (C) 1998-2003 Ullrich von Bassewitz */
|
||||
/* Römerstrasse 52 */
|
||||
/* D-70794 Filderstadt */
|
||||
/* EMail: uz@cc65.org */
|
||||
/* */
|
||||
/* */
|
||||
/* This software is provided 'as-is', without any expressed or implied */
|
||||
@ -124,6 +124,7 @@ enum Errors {
|
||||
ERR_DUPLICATE_ELSE,
|
||||
ERR_OPEN_IF,
|
||||
ERR_OPEN_PROC,
|
||||
ERR_NO_OPEN_PROC,
|
||||
ERR_SEG_ATTR_MISMATCH,
|
||||
ERR_SEGSTACK_OVERFLOW,
|
||||
ERR_SEGSTACK_EMPTY,
|
||||
|
@ -606,8 +606,13 @@ static void DoEnd (void)
|
||||
static void DoEndProc (void)
|
||||
/* Leave a lexical level */
|
||||
{
|
||||
if (!SymIsLocalLevel ()) {
|
||||
/* No local symbol table level open */
|
||||
ErrorSkip (ERR_NO_OPEN_PROC);
|
||||
} else {
|
||||
SymLeaveLevel ();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -385,6 +385,14 @@ void SymLeaveLevel (void)
|
||||
|
||||
|
||||
|
||||
int SymIsLocalLevel (void)
|
||||
/* Return true if we ae on a local symbol table level. */
|
||||
{
|
||||
return (SymTab != RootTab);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void SymDef (const char* Name, ExprNode* Expr, int ZP, int Label)
|
||||
/* Define a new symbol */
|
||||
{
|
||||
|
@ -73,6 +73,9 @@ void SymEnterLevel (void);
|
||||
void SymLeaveLevel (void);
|
||||
/* Leave the current lexical level */
|
||||
|
||||
int SymIsLocalLevel (void);
|
||||
/* Return true if we ae on a local symbol table level. */
|
||||
|
||||
void SymDef (const char* Name, ExprNode* Expr, int ZP, int Label);
|
||||
/* Define a new symbol */
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user