aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tccgen.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/tccgen.c b/tccgen.c
index 7295267..26a5781 100644
--- a/tccgen.c
+++ b/tccgen.c
@@ -1678,6 +1678,9 @@ ST_FUNC void gen_op(int op)
(op < TOK_ULT || op > TOK_GT))
tcc_error("invalid operands for binary operation");
goto std_op;
+ } else if (op == TOK_SHR || op == TOK_SAR || op == TOK_SHL) {
+ t = (bt1 == VT_LLONG ? VT_LLONG : VT_INT) | (t1 & VT_UNSIGNED);
+ goto std_op;
} else if (bt1 == VT_LLONG || bt2 == VT_LLONG) {
/* cast to biggest op */
t = VT_LLONG;