From bc48cc1edb402b90de01a061f404164bb32f133f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Gl=C3=B6ckner?= Date: Thu, 8 Oct 2009 00:24:21 +0200 Subject: [PATCH] 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. --- tccgen.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tccgen.c b/tccgen.c index 0ced4b6..78a5161 100644 --- a/tccgen.c +++ b/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