aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLee Duhem <lee.duhem@gmail.com>2014-12-11 09:46:36 +0800
committerLee Duhem <lee.duhem@gmail.com>2014-12-11 10:04:22 +0800
commitf1703e2b2f0b032d01a35a4a2d4db927698837da (patch)
tree0c0d5b5787ddd6e4d10dd615968aa73ffabb86cc
parent4bf3f6c965d5b9773fa7767d583c4fd579e99f57 (diff)
downloadtinycc-f1703e2b2f0b032d01a35a4a2d4db927698837da.tar.gz
tinycc-f1703e2b2f0b032d01a35a4a2d4db927698837da.tar.bz2
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.
-rw-r--r--libtcc.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/libtcc.c b/libtcc.c
index b0ac2c7..6eea9a7 100644
--- a/libtcc.c
+++ b/libtcc.c
@@ -459,9 +459,8 @@ ST_FUNC void put_extern_sym2(Sym *sym, Section *section,
if (!sym->c) {
name = get_tok_str(sym->v, NULL);
#ifdef CONFIG_TCC_BCHECK
+ char buf[32];
if (tcc_state->do_bounds_check) {
- char buf[32];
-
/* XXX: avoid doing that for statics ? */
/* if bound checking is activated, we change some function
names by adding the "__bound" prefix */