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:
committed by
grischka
parent
5b113f3ee3
commit
bc48cc1edb
1
tccgen.c
1
tccgen.c
@ -1306,6 +1306,7 @@ void gen_op(int op)
|
|||||||
swap(&t1, &t2);
|
swap(&t1, &t2);
|
||||||
}
|
}
|
||||||
type1 = vtop[-1].type;
|
type1 = vtop[-1].type;
|
||||||
|
type1.t &= ~VT_ARRAY;
|
||||||
#ifdef TCC_TARGET_X86_64
|
#ifdef TCC_TARGET_X86_64
|
||||||
vpushll(pointed_size(&vtop[-1].type));
|
vpushll(pointed_size(&vtop[-1].type));
|
||||||
#else
|
#else
|
||||||
|
|||||||
Reference in New Issue
Block a user