From 83fd36333a691050663a15c07b385bdf554bf01d Mon Sep 17 00:00:00 2001 From: Shinichiro Hamaji Date: Thu, 16 Apr 2009 02:34:59 +0900 Subject: Fixes for issues I've just found/introduced to x86 TCC. - Cast from pointer to long long makes TCC output an error. Use cast to int before we apply shift operation for a pointer value. - Removed test cases for casts from pointer to char/short because they produce warning. --- tcc.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'tcc.c') diff --git a/tcc.c b/tcc.c index 1b0db21..00fd3a0 100644 --- a/tcc.c +++ b/tcc.c @@ -6219,6 +6219,11 @@ static void gen_cast(CType *type) vpushi(0); gv(RC_INT); } else { + if (sbt == VT_PTR) { + /* cast from pointer to int before we apply + shift operation, which pointers don't support*/ + gen_cast(&int_type); + } gv_dup(); vpushi(31); gen_op(TOK_SAR); -- cgit v1.3.1