tccgen.c: Try to make sizeof(!x) work.

tests/tests2/27_sizeof.*: Add test.
master
Edmund Grimley Evans 2015-11-22 00:00:36 +00:00
parent 737f984213
commit 7301b42e36
3 changed files with 4 additions and 3 deletions

View File

@ -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();

View File

@ -10,6 +10,8 @@ int main()
printf("%d\n", sizeof(b));
printf("%d\n", sizeof(c));
printf("%d\n", sizeof(!a));
return 0;
}

View File

@ -1,3 +1,4 @@
1
4
8
4