diff options
| author | bellard <bellard> | 2006-10-28 14:47:39 +0000 |
|---|---|---|
| committer | bellard <bellard> | 2006-10-28 14:47:39 +0000 |
| commit | fb2c34f8cdc59c0bffb0dec444c78c602afcaf6a (patch) | |
| tree | 28c595968acae0c78d77840f149692d64ea1b562 /tcc.c | |
| parent | 65b974e396288c21e0a62aba4a346717fde12060 (diff) | |
| download | tinycc-fb2c34f8cdc59c0bffb0dec444c78c602afcaf6a.tar.gz tinycc-fb2c34f8cdc59c0bffb0dec444c78c602afcaf6a.tar.bz2 | |
fixed sign extension in some type conversions (Dave Dodge)
Diffstat (limited to 'tcc.c')
| -rw-r--r-- | tcc.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -5764,6 +5764,10 @@ void force_charshort_cast(int t) bits = 32 - bits; vpushi(bits); gen_op(TOK_SHL); + /* result must be signed or the SAR is converted to an SHL + This was not the case when "t" was a signed short + and the last value on the stack was an unsigned int */ + vtop->type.t &= ~VT_UNSIGNED; vpushi(bits); gen_op(TOK_SAR); } |
