History

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

tests/tests2/27_sizeof.*: Add test.

Edmund Grimley Evans committed 10 years ago

Commit 7301b421 parent 737f9843 files · +4 −3Browse files

Unified · Split

3 files
  1. tccgen.c +1 −3
  2. tests/tests2/27_sizeof.c +2 −0
  3. tests/tests2/27_sizeof.expect +1 −0
tccgen.c+1−3
@@ -3877,12 +3877,10 @@ ST_FUNC void unary(void) · 3876 unmodified lines
38773877 vtop->c.i = !vtop->c.i;
38783878 } else if ((vtop->r & VT_VALMASK) == VT_CMP)
38793879 vtop->c.i ^= 1;
3880− else if (!nocode_wanted) {
3880+ else {
38813881 save_regs(1);
38823882 vseti(VT_JMP, gvtst(1, 0));
38833883 }
3884− else
3885− vtop--;
38863884 break;
38873885 case '~':
38883886 next();
tests/tests2/27_sizeof.c+2−0
@@ -10,6 +10,8 @@ int main() · 9 unmodified lines
1010 printf("%d\n", sizeof(b));
1111 printf("%d\n", sizeof(c));
1212
13+ printf("%d\n", sizeof(!a));
14+
1315 return 0;
1416 }
1517
tests/tests2/27_sizeof.expect+1−0
@@ -1,3 +1,4 @@
11 1
22 4
33 8
4+4

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t