1
0
mirror of https://github.com/mirror/tinycc.git synced 2025-04-17 13:30:35 +08:00

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:
Daniel Glöckner 2009-10-08 00:24:21 +02:00 committed by grischka
parent 5b113f3ee3
commit bc48cc1edb

View File

@ -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