mirror of
https://github.com/cc65/cc65.git
synced 2024-11-13 13:11:06 +00:00
Fixed problem with forward references in unnamed labels
git-svn-id: svn://svn.cc65.org/cc65/trunk@853 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
parent
b3af17126c
commit
4ce28c0cd5
@ -37,7 +37,7 @@
|
||||
#include "check.h"
|
||||
#include "filepos.h"
|
||||
#include "xmalloc.h"
|
||||
|
||||
|
||||
/* ca65 */
|
||||
#include "error.h"
|
||||
#include "expr.h"
|
||||
@ -53,8 +53,8 @@
|
||||
|
||||
|
||||
/* Struct that describes an unnamed label */
|
||||
typedef struct ULabel_ ULabel;
|
||||
struct ULabel_ {
|
||||
typedef struct ULabel ULabel;
|
||||
struct ULabel {
|
||||
ULabel* Prev; /* Pointer to previous node in list */
|
||||
ULabel* Next; /* Pointer to next node in list */
|
||||
FilePos Pos; /* Position of the label in the source */
|
||||
@ -145,14 +145,11 @@ ExprNode* ULabRef (int Which)
|
||||
} else {
|
||||
/* Forward reference. Create labels as needed */
|
||||
unsigned LabelNum = ULabDefCount + Which - 1;
|
||||
while (Which > 0) {
|
||||
if (L->Next == 0) {
|
||||
NewULabel (0);
|
||||
}
|
||||
L = L->Next;
|
||||
--Which;
|
||||
}
|
||||
/* Return an unnamed label expression */
|
||||
while (LabelNum < ULabCount) {
|
||||
NewULabel (0);
|
||||
}
|
||||
|
||||
/* Return an unnamed label expression */
|
||||
return ULabelExpr (LabelNum);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user