History

fixed sign extension in some type conversions (Dave Dodge)

bellard committed 20 years ago

Commit fb2c34f1 parent 65b974e1 file · +4 −0Browse files

Unified · Split

tcc.c+4−0
@@ -5764,6 +5764,10 @@ void force_charshort_cast(int t) · 5763 unmodified lines
5764 bits = 32 - bits;5764 bits = 32 - bits;
5765 vpushi(bits);5765 vpushi(bits);
5766 gen_op(TOK_SHL);5766 gen_op(TOK_SHL);
5767 /* result must be signed or the SAR is converted to an SHL
5768 This was not the case when "t" was a signed short
5769 and the last value on the stack was an unsigned int */
5770 vtop->type.t &= ~VT_UNSIGNED;
5767 vpushi(bits);5771 vpushi(bits);
5768 gen_op(TOK_SAR);5772 gen_op(TOK_SAR);
5769 }5773 }

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