diff options
Diffstat (limited to 'tccgen.c')
| -rw-r--r-- | tccgen.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -1679,7 +1679,9 @@ ST_FUNC void gen_op(int op) 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); + t = bt1 == VT_LLONG ? VT_LLONG : VT_INT; + if ((t1 & (VT_BTYPE | VT_UNSIGNED)) == (t | VT_UNSIGNED)) + t |= VT_UNSIGNED; goto std_op; } else if (bt1 == VT_LLONG || bt2 == VT_LLONG) { /* cast to biggest op */ |
