mirror of
https://github.com/mirror/tinycc.git
synced 2025-01-01 04:20:09 +08:00
libtcc.c (put_extern_sym2): Extend the scope of buf to match its use
After leaving the code block that `buf' is defined, `buf' will not exist, so `name' will point to a variable that does not exist.
This commit is contained in:
parent
4bf3f6c965
commit
f1703e2b2f
3
libtcc.c
3
libtcc.c
@ -459,9 +459,8 @@ ST_FUNC void put_extern_sym2(Sym *sym, Section *section,
|
|||||||
if (!sym->c) {
|
if (!sym->c) {
|
||||||
name = get_tok_str(sym->v, NULL);
|
name = get_tok_str(sym->v, NULL);
|
||||||
#ifdef CONFIG_TCC_BCHECK
|
#ifdef CONFIG_TCC_BCHECK
|
||||||
|
char buf[32];
|
||||||
if (tcc_state->do_bounds_check) {
|
if (tcc_state->do_bounds_check) {
|
||||||
char buf[32];
|
|
||||||
|
|
||||||
/* XXX: avoid doing that for statics ? */
|
/* XXX: avoid doing that for statics ? */
|
||||||
/* if bound checking is activated, we change some function
|
/* if bound checking is activated, we change some function
|
||||||
names by adding the "__bound" prefix */
|
names by adding the "__bound" prefix */
|
||||||
|
Loading…
Reference in New Issue
Block a user