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
57645764 bits = 32 - bits;
57655765 vpushi(bits);
57665766 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;
57675771 vpushi(bits);
57685772 gen_op(TOK_SAR);
57695773 }

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