tccgen.c: Try to make sizeof(!x) work.
tests/tests2/27_sizeof.*: Add test.
This commit is contained in:
4
tccgen.c
4
tccgen.c
@ -3877,12 +3877,10 @@ ST_FUNC void unary(void)
|
|||||||
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 ^= 1;
|
vtop->c.i ^= 1;
|
||||||
else if (!nocode_wanted) {
|
else {
|
||||||
save_regs(1);
|
save_regs(1);
|
||||||
vseti(VT_JMP, gvtst(1, 0));
|
vseti(VT_JMP, gvtst(1, 0));
|
||||||
}
|
}
|
||||||
else
|
|
||||||
vtop--;
|
|
||||||
break;
|
break;
|
||||||
case '~':
|
case '~':
|
||||||
next();
|
next();
|
||||||
|
|||||||
@ -10,6 +10,8 @@ int main()
|
|||||||
printf("%d\n", sizeof(b));
|
printf("%d\n", sizeof(b));
|
||||||
printf("%d\n", sizeof(c));
|
printf("%d\n", sizeof(c));
|
||||||
|
|
||||||
|
printf("%d\n", sizeof(!a));
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
1
|
1
|
||||||
4
|
4
|
||||||
8
|
8
|
||||||
|
4
|
||||||
|
|||||||
Reference in New Issue
Block a user