[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Tinycc-devel] tcc 0.9.23 shift generation bug
From: |
Zdenek Pavlas |
Subject: |
Re: [Tinycc-devel] tcc 0.9.23 shift generation bug |
Date: |
Tue, 28 Jun 2005 12:33:34 +0200 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.8) Gecko/20050513 Debian/1.7.8-1 |
Signed shifts of signed integers should not give unsigned results.
This fix is probably a better one.
--- tcc.c.orig 2005-06-18 00:09:15.000000000 +0200
+++ tcc.c 2005-06-28 12:17:44.472171840 +0200
@@ -5628,7 +5628,8 @@
t = VT_INT;
/* convert to unsigned if it does not fit in an integer */
if ((t1 & (VT_BTYPE | VT_UNSIGNED)) == (VT_INT | VT_UNSIGNED) ||
- (t2 & (VT_BTYPE | VT_UNSIGNED)) == (VT_INT | VT_UNSIGNED))
+ (t2 & (VT_BTYPE | VT_UNSIGNED)) == (VT_INT | VT_UNSIGNED) &&
+ (op != TOK_SAR))
t |= VT_UNSIGNED;
std_op:
/* XXX: currently, some unsigned operations are explicit, so
--
Zdenek Pavlas