tccasm: Fix local statics referenced from asms
commit2acb04f7f2077a4cff103421d79ceee48441918a
authorMichael Matz <matz@suse.de>
Mon, 10 Jul 2017 20:29:28 +0000 (10 22:29 +0200)
committerMichael Matz <matz@suse.de>
Mon, 10 Jul 2017 20:29:28 +0000 (10 22:29 +0200)
treeb7ac49fd8970c672c542874131c47afa7b92245c
parent9bea88d61611dc12eeb211e342461f9157177464
tccasm: Fix local statics referenced from asms

The assembler uses the ->sym_scope member to walk up the symbols
until finding a non-automatic symbol.  Since reordering the
members of Sym the sym_scope member contains a scope even for local
statics.  Formerly the use of asm_label for statics was implicitely
clearing sym_scope, now we have to do that explicitely.

Add a testcase for that, and one I encountered when moving the
clearing of sym_scope too deep into the call chain (into put_extern_sym).
tccgen.c
tests/tcctest.c