mirror of
https://github.com/mirror/tinycc.git
synced 2025-01-19 05:30:07 +08:00
Cast parameter of '!' to _Bool
This commit is contained in:
parent
2d9b5e0bb8
commit
1b599ea7f8
7
tcc.c
7
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);
|
||||
|
Loading…
Reference in New Issue
Block a user