History

Incorrect shift result type on unsigned short first argument.

The code for shifts is now similar to code for binary arithmetic operations, except that only the first argument is considered, as required by the ISO C standard.

Vincent Lefevre committed 14 years ago

Commit d27a0b31 parent 09b98a41 file · +3 −1Browse files

Unified · Split

tccgen.c+3−1
@@ -1679,7 +1679,9 @@ ST_FUNC void gen_op(int op) · 1678 unmodified lines
1679 tcc_error("invalid operands for binary operation");1679 tcc_error("invalid operands for binary operation");
1680 goto std_op;1680 goto std_op;
1681 } else if (op == TOK_SHR || op == TOK_SAR || op == TOK_SHL) {1681 } else if (op == TOK_SHR || op == TOK_SAR || op == TOK_SHL) {
1682 t = (bt1 == VT_LLONG ? VT_LLONG : VT_INT) | (t1 & VT_UNSIGNED);1682 t = bt1 == VT_LLONG ? VT_LLONG : VT_INT;
1683 if ((t1 & (VT_BTYPE | VT_UNSIGNED)) == (t | VT_UNSIGNED))
1684 t |= VT_UNSIGNED;
1683 goto std_op;1685 goto std_op;
1684 } else if (bt1 == VT_LLONG || bt2 == VT_LLONG) {1686 } else if (bt1 == VT_LLONG || bt2 == VT_LLONG) {
1685 /* cast to biggest op */1687 /* cast to biggest op */

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t