aboutsummaryrefslogtreecommitdiff
path: root/tccgen.c
diff options
context:
space:
mode:
authorgrischka <grischka>2016-12-18 22:05:42 +0100
committergrischka <grischka>2016-12-18 22:05:42 +0100
commita1c12b9fb9bd2452a90d3cf504574b3605c09702 (patch)
tree3166ee219d1463f5ed5bfc00aada753502fbe706 /tccgen.c
parentf7fc4f02cf15e061b98b2224332b1739c69ef9db (diff)
downloadtinycc-a1c12b9fb9bd2452a90d3cf504574b3605c09702.tar.gz
tinycc-a1c12b9fb9bd2452a90d3cf504574b3605c09702.tar.bz2
tests: add memory leak test
Also ... tcctest.c: - exclude stuff that gcc doesn't compile on windows. libtcc.c/tccpp.c: - use unsigned for memory sizes to avoid printf format warnings - use "file:line: message" to make IDE error parsers happy. tccgen.c: fix typo
Diffstat (limited to 'tccgen.c')
-rw-r--r--tccgen.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/tccgen.c b/tccgen.c
index a4a40f3..dddeea1 100644
--- a/tccgen.c
+++ b/tccgen.c
@@ -5288,8 +5288,8 @@ static void expr_cond(void)
/* this is horrible, but we must also convert first
operand */
- vpushv(&sv);
- if (c != 2) {
+ if (c != 0) {
+ *vtop = sv;
gen_cast(&type);
if (islv) {
mk_pointer(&vtop->type);
@@ -5298,17 +5298,14 @@ static void expr_cond(void)
gaddrof();
}
- if (c != 0)
- vswap();
- vtop--;
if (c < 0) {
r1 = gv(rc);
move_reg(r2, r1, type.t);
vtop->r = r2;
+ gsym(tt);
+ if (islv)
+ indir();
}
- gsym(tt);
- if (islv)
- indir();
}
}
}