aboutsummaryrefslogtreecommitdiff
path: root/tcc.c
diff options
context:
space:
mode:
Diffstat (limited to 'tcc.c')
-rw-r--r--tcc.c5
1 files changed, 5 insertions, 0 deletions
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);