Hi,

In `put_extern_sym2', 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
patch fixes that.

Any comment?

Sincerely,
lee
From f1703e2b2f0b032d01a35a4a2d4db927698837da Mon Sep 17 00:00:00 2001
From: Lee Duhem <[email protected]>
Date: Thu, 11 Dec 2014 09:46:36 +0800
Subject: [PATCH] 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.
---
 libtcc.c | 3 +--
 1 file changed, 1 insertion(+), 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 */
-- 
1.9.3

_______________________________________________
Tinycc-devel mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/tinycc-devel

Reply via email to