History

fix sizeof(array + integer)

Previously sizeof would return the size of the array although the expression is always a plain pointer of 4 (or 8) bytes.

Daniel Glöckner committed 17 years ago

Commit bc48cc11 parent 5b113f31 file · +1 −0Browse files

Unified · Split

tccgen.c+1−0
@@ -1306,6 +1306,7 @@ void gen_op(int op) · 1305 unmodified lines
13061306 swap(&t1, &t2);
13071307 }
13081308 type1 = vtop[-1].type;
1309+ type1.t &= ~VT_ARRAY;
13091310 #ifdef TCC_TARGET_X86_64
13101311 vpushll(pointed_size(&vtop[-1].type));
13111312 #else

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