aboutsummaryrefslogtreecommitdiff
path: root/tcc.c
diff options
context:
space:
mode:
authorDaniel Glöckner <daniel-gl@gmx.net>2008-11-20 11:37:46 +0100
committergrischka <grischka>2008-11-30 07:21:35 +0100
commit1b599ea7f8614b19762816d35eef467b8c9bd178 (patch)
tree1484a25fa9efa2482039f48f1ae15947a8869028 /tcc.c
parent2d9b5e0bb8b865cae7a9c93d9643e77ffab9c4f1 (diff)
downloadtinycc-1b599ea7f8614b19762816d35eef467b8c9bd178.tar.gz
tinycc-1b599ea7f8614b19762816d35eef467b8c9bd178.tar.bz2
Cast parameter of '!' to _Bool
Diffstat (limited to 'tcc.c')
-rw-r--r--tcc.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/tcc.c b/tcc.c
index 015d403..100db98 100644
--- a/tcc.c
+++ b/tcc.c
@@ -7516,9 +7516,12 @@ static void unary(void)
case '!':
next();
unary();
- if ((vtop->r & (VT_VALMASK | VT_LVAL | VT_SYM)) == VT_CONST)
+ if ((vtop->r & (VT_VALMASK | VT_LVAL | VT_SYM)) == VT_CONST) {
+ CType boolean;
+ boolean.t = VT_BOOL;
+ gen_cast(&boolean);
vtop->c.i = !vtop->c.i;
- else if ((vtop->r & VT_VALMASK) == VT_CMP)
+ } else if ((vtop->r & VT_VALMASK) == VT_CMP)
vtop->c.i = vtop->c.i ^ 1;
else {
save_regs(1);