mirror of
https://github.com/mirror/tinycc.git
synced 2025-03-28 12:10:05 +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 '!':
|
case '!':
|
||||||
next();
|
next();
|
||||||
unary();
|
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;
|
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;
|
vtop->c.i = vtop->c.i ^ 1;
|
||||||
else {
|
else {
|
||||||
save_regs(1);
|
save_regs(1);
|
||||||
|
Loading…
Reference in New Issue
Block a user