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
3877 vtop->c.i = !vtop->c.i;3877 vtop->c.i = !vtop->c.i;
3878 } else if ((vtop->r & VT_VALMASK) == VT_CMP)3878 } else if ((vtop->r & VT_VALMASK) == VT_CMP)
3879 vtop->c.i ^= 1;3879 vtop->c.i ^= 1;
3880 else if (!nocode_wanted) {3880 else {
3881 save_regs(1);3881 save_regs(1);
3882 vseti(VT_JMP, gvtst(1, 0));3882 vseti(VT_JMP, gvtst(1, 0));
3883 }3883 }
3884 else
3885 vtop--;
3886 break;3884 break;
3887 case '~':3885 case '~':
3888 next();3886 next();
tests/tests2/27_sizeof.c+2−0
@@ -10,6 +10,8 @@ int main() · 9 unmodified lines
10 printf("%d\n", sizeof(b));10 printf("%d\n", sizeof(b));
11 printf("%d\n", sizeof(c));11 printf("%d\n", sizeof(c));
12 12
13 printf("%d\n", sizeof(!a));
14
13 return 0;15 return 0;
14}16}
15 17
tests/tests2/27_sizeof.expect+1−0
@@ -1,3 +1,4 @@
1111
2424
3838
44

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