Skip to content

Commit 282988e

Browse files
committed
better lookup of symbols while inside %namesp
1 parent 38e08c1 commit 282988e

File tree

3 files changed

+25
-1
lines changed

3 files changed

+25
-1
lines changed

Test/Expect/bin_namesp.obj

32 Bytes
Binary file not shown.

Test/bin_namesp.spin2

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{Spin2_v50}
2+
CON pin_base = 40
3+
4+
DAT
5+
org
6+
a
7+
jmp #\foo.a
8+
long 0
9+
b
10+
long @@@a
11+
12+
%namesp foo
13+
a
14+
jmp #\a
15+
b
16+
long $100 + pin_base
17+
long @@@a
18+
19+
%namesp
20+
c
21+
long @@@foo.b
22+
long $FFFF
23+

expr.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,8 @@ LookupSymbolInFunc(Function *func, const char *name)
167167
sym = LookupSymbolInTable(&func->localsyms, name);
168168
} else if (current->name_space) {
169169
sym = LookupSymbolInTable(current->name_space, name);
170-
} else {
170+
}
171+
if (!sym) {
171172
sym = LookupSymbolInTable(&current->objsyms, name);
172173
}
173174
if (!sym) {

0 commit comments

Comments
 (0)