aboutsummaryrefslogtreecommitdiff
path: root/tccgen.c
diff options
context:
space:
mode:
authorjiang <30155751@qq.com>2014-05-01 15:15:01 +0800
committerjiang <30155751@qq.com>2014-05-01 15:15:01 +0800
commit87a850f5537cccabc56d2f9b76faefe1454e4b19 (patch)
tree2f4078dc037e873d630b8e4d68518fe2697179a7 /tccgen.c
parent9e3713facd9d857201326ac2038ab6a8fb64a5fc (diff)
downloadtinycc-87a850f5537cccabc56d2f9b76faefe1454e4b19.tar.gz
tinycc-87a850f5537cccabc56d2f9b76faefe1454e4b19.tar.bz2
fix its own making bug. Improved init_putz (). Modify the tests / Makefile to make the test more secure
Diffstat (limited to 'tccgen.c')
-rw-r--r--tccgen.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/tccgen.c b/tccgen.c
index daf5f48..20011a0 100644
--- a/tccgen.c
+++ b/tccgen.c
@@ -5224,16 +5224,17 @@ static void init_putz(CType *t, Section *sec, unsigned long c, int size)
if (sec) {
/* nothing to do because globals are already set to zero */
} else {
+#ifdef TCC_TARGET_ARM
vpush_global_sym(&func_old_type, TOK_memset);
vseti(VT_LOCAL, c);
-#ifdef TCC_TARGET_ARM
vpushs(size);
vpushi(0);
+ gfunc_call(3);
#else
- vpushi(0);
- vpushs(size);
+ vseti(VT_LOCAL, c);
+ gen_putz(vtop, size);
+ vtop--;
#endif
- gfunc_call(3);
}
}