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.
This commit is contained in:
parent
5b113f3ee3
commit
bc48cc1edb
1 changed files with 1 additions and 0 deletions
1
tccgen.c
1
tccgen.c
|
@ -1306,6 +1306,7 @@ void gen_op(int op)
|
|||
swap(&t1, &t2);
|
||||
}
|
||||
type1 = vtop[-1].type;
|
||||
type1.t &= ~VT_ARRAY;
|
||||
#ifdef TCC_TARGET_X86_64
|
||||
vpushll(pointed_size(&vtop[-1].type));
|
||||
#else
|
||||
|
|
Loading…
Add table
Reference in a new issue