} else {
/* Add a new label symbol if we don't have one until now */
- SymEntry* Entry = AddLabelSym (CurTok.Ident, SC_REF);
+ SymEntry* Entry = AddLabelSym (CurTok.Ident, SC_REF | SC_GOTO);
/* Jump to the label */
g_jump (Entry->V.L.Label);
for (i = 0; i < CollCount (Entry->V.L.DefsOrRefs); i++) {
DOR = CollAt (Entry->V.L.DefsOrRefs, i);
- if ((DOR->Flags & SC_DEF) && (Flags & SC_REF)) {
+ if ((DOR->Flags & SC_DEF) && (Flags & SC_REF) && (Flags & SC_GOTO)) {
/* We're processing a goto and here is its destination label.
This means the difference between SP values is already known,
so we simply emit the SP adjustment code. */
}
- if ((DOR->Flags & SC_REF) && (Flags & SC_DEF)) {
+ if ((DOR->Flags & SC_REF) && (DOR->Flags & SC_GOTO) && (Flags & SC_DEF)) {
/* We're processing a label, let's update all gotos encountered
so far */
g_defdatalabel (DOR->LateSP_Label);
}
/* We are processing a goto, but the label has not yet been defined */
- if (!SymIsDef (Entry) && (Flags & SC_REF)) {
+ if (!SymIsDef (Entry) && (Flags & SC_REF) && (Flags & SC_GOTO)) {
g_lateadjustSP (NewDOR->LateSP_Label);
}