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:
@@ -53,8 +53,8 @@
|
|||||||
|
|
||||||
|
|
||||||
/* Struct that describes an unnamed label */
|
/* Struct that describes an unnamed label */
|
||||||
typedef struct ULabel_ ULabel;
|
typedef struct ULabel ULabel;
|
||||||
struct ULabel_ {
|
struct ULabel {
|
||||||
ULabel* Prev; /* Pointer to previous node in list */
|
ULabel* Prev; /* Pointer to previous node in list */
|
||||||
ULabel* Next; /* Pointer to next node in list */
|
ULabel* Next; /* Pointer to next node in list */
|
||||||
FilePos Pos; /* Position of the label in the source */
|
FilePos Pos; /* Position of the label in the source */
|
||||||
@@ -145,13 +145,10 @@ ExprNode* ULabRef (int Which)
|
|||||||
} else {
|
} else {
|
||||||
/* Forward reference. Create labels as needed */
|
/* Forward reference. Create labels as needed */
|
||||||
unsigned LabelNum = ULabDefCount + Which - 1;
|
unsigned LabelNum = ULabDefCount + Which - 1;
|
||||||
while (Which > 0) {
|
while (LabelNum < ULabCount) {
|
||||||
if (L->Next == 0) {
|
|
||||||
NewULabel (0);
|
NewULabel (0);
|
||||||
}
|
}
|
||||||
L = L->Next;
|
|
||||||
--Which;
|
|
||||||
}
|
|
||||||
/* Return an unnamed label expression */
|
/* Return an unnamed label expression */
|
||||||
return ULabelExpr (LabelNum);
|
return ULabelExpr (LabelNum);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user