mirror of
https://github.com/ksherlock/x65.git
synced 2025-01-16 08:33:28 +00:00
Fixed scoped labels turning into local labels and expiring when endscope is encountered
This commit is contained in:
parent
40512e1b64
commit
42c45b0fe9
Binary file not shown.
BIN
bin/x65_x64.zip
BIN
bin/x65_x64.zip
Binary file not shown.
7
x65.cpp
7
x65.cpp
@ -4165,7 +4165,8 @@ StatusCode Asm::AddressLabel(strref label)
|
||||
pLabel->constant = constLabel;
|
||||
last_label = label;
|
||||
bool local = label[0]=='.' || label[0]=='@' || label[0]=='!' || label[0]==':' || label.get_last()=='$';
|
||||
LabelAdded(pLabel, local || directive_scope_depth>0); // TODO: in named scopes the label can still be referenced outside the scope directive
|
||||
if (directive_scope_depth > 0) { local = true; }
|
||||
LabelAdded(pLabel, local); // TODO: in named scopes the label can still be referenced outside the scope directive
|
||||
if (local) { MarkLabelLocal(label); }
|
||||
status = CheckLateEval(label);
|
||||
if (!local && label[0]!=']') { // MERLIN: Variable label does not invalidate local labels
|
||||
@ -5383,11 +5384,11 @@ StatusCode Asm::ApplyDirective(AssemblerDirective dir, strref line, strref sourc
|
||||
|
||||
case AD_SCOPE:
|
||||
directive_scope_depth++;
|
||||
break;
|
||||
return EnterScope();
|
||||
|
||||
case AD_ENDSCOPE:
|
||||
directive_scope_depth--;
|
||||
break;
|
||||
return ExitScope();
|
||||
|
||||
case AD_DS:
|
||||
return Directive_DS(line);
|
||||
|
Loading…
x
Reference in New Issue
Block a user