aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgrischka <grischka>2017-02-12 13:13:49 +0100
committergrischka <grischka>2017-02-12 13:21:20 +0100
commitec6a997f80b85e8e23bb2c47e87a58ee84518a77 (patch)
treee1427003bf626769d30f480c35831f6a37dcdd9f
parent417a1ed38400354815d781daa2074cbb1fe9960e (diff)
downloadtinycc-ec6a997f80b85e8e23bb2c47e87a58ee84518a77.tar.gz
tinycc-ec6a997f80b85e8e23bb2c47e87a58ee84518a77.tar.bz2
tccgen: yet another nocode_wanted fix
Some code in gen_opl was depending on a gvtst label which in nocode_wanted mode is not set. This was causing vstack leaks and crashes with for example long long ll; if (0) return ll - 10 < 0;
-rw-r--r--tccgen.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/tccgen.c b/tccgen.c
index 0f08c35..a0284ff 100644
--- a/tccgen.c
+++ b/tccgen.c
@@ -1614,7 +1614,7 @@ static void gen_opl(int op)
if (op != TOK_EQ) {
/* generate non equal test */
/* XXX: NOT PORTABLE yet */
- if (a == 0) {
+ if (op1 == TOK_NE) {
b = gvtst(0, 0);
} else {
#if defined(TCC_TARGET_I386)
@@ -1622,10 +1622,8 @@ static void gen_opl(int op)
#elif defined(TCC_TARGET_ARM)
b = ind;
o(0x1A000000 | encbranch(ind, 0, 1));
-#elif defined(TCC_TARGET_C67) || defined(TCC_TARGET_ARM64)
- tcc_error("not implemented");
#else
-#error not supported
+ tcc_error("not implemented");
#endif
}
}