mirror of
https://github.com/frida/tinycc
synced 2024-12-25 06:26:49 +03:00
tccgen.c: Try to make sizeof(!x) work.
tests/tests2/27_sizeof.*: Add test.
This commit is contained in:
parent
737f984213
commit
7301b42e36
4
tccgen.c
4
tccgen.c
@ -3877,12 +3877,10 @@ ST_FUNC void unary(void)
|
||||
vtop->c.i = !vtop->c.i;
|
||||
} else if ((vtop->r & VT_VALMASK) == VT_CMP)
|
||||
vtop->c.i ^= 1;
|
||||
else if (!nocode_wanted) {
|
||||
else {
|
||||
save_regs(1);
|
||||
vseti(VT_JMP, gvtst(1, 0));
|
||||
}
|
||||
else
|
||||
vtop--;
|
||||
break;
|
||||
case '~':
|
||||
next();
|
||||
|
@ -10,6 +10,8 @@ int main()
|
||||
printf("%d\n", sizeof(b));
|
||||
printf("%d\n", sizeof(c));
|
||||
|
||||
printf("%d\n", sizeof(!a));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
1
|
||||
4
|
||||
8
|
||||
4
|
||||
|
Loading…
Reference in New Issue
Block a user