aboutsummaryrefslogtreecommitdiff
path: root/tccgen.c
diff options
context:
space:
mode:
Diffstat (limited to 'tccgen.c')
-rw-r--r--tccgen.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/tccgen.c b/tccgen.c
index 2376848..398e165 100644
--- a/tccgen.c
+++ b/tccgen.c
@@ -1948,7 +1948,10 @@ static void force_charshort_cast(int t)
vpushi((1 << bits) - 1);
gen_op('&');
} else {
- bits = 32 - bits;
+ if ((vtop->type.t & VT_BTYPE) == VT_LLONG)
+ bits = 64 - bits;
+ else
+ bits = 32 - bits;
vpushi(bits);
gen_op(TOK_SHL);
/* result must be signed or the SAR is converted to an SHL