summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2003-12-08 19:47:12 +0000
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2003-12-08 19:47:12 +0000
commit186ca3debd66685d7f14ba267b7c7a5e9a8d63c8 (patch)
treebd2979b87b531da386bad46620e258928d3af7ef
parent0e0727c44940fbd4cfce07907af2d8b78df2d2a1 (diff)
downloadgcc-186ca3debd66685d7f14ba267b7c7a5e9a8d63c8.tar.gz
* unwind-pe.h (read_uleb128): Fix handling of large values
(read_sleb128): Fix handling of large values git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@74429 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/unwind-pe.h6
2 files changed, 8 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 3cc34b5df8e..6ec2cdd8ac8 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2003-12-08 Jan Hubicka <jh@suse.cz>
+
+ * unwind-pe.h (read_uleb128): Fix handling of large values
+ (read_sleb128): Fix handling of large values
+
2003-12-08 Andrew Pinski <pinskia@physics.uc.edu>
PR middle-end/10060
diff --git a/gcc/unwind-pe.h b/gcc/unwind-pe.h
index e6aebd7a411..4bf2cfd3f02 100644
--- a/gcc/unwind-pe.h
+++ b/gcc/unwind-pe.h
@@ -137,7 +137,7 @@ read_uleb128 (const unsigned char *p, _Unwind_Word *val)
do
{
byte = *p++;
- result |= (byte & 0x7f) << shift;
+ result |= ((_Unwind_Word)byte & 0x7f) << shift;
shift += 7;
}
while (byte & 0x80);
@@ -159,14 +159,14 @@ read_sleb128 (const unsigned char *p, _Unwind_Sword *val)
do
{
byte = *p++;
- result |= (byte & 0x7f) << shift;
+ result |= ((_Unwind_Word)byte & 0x7f) << shift;
shift += 7;
}
while (byte & 0x80);
/* Sign-extend a negative value. */
if (shift < 8 * sizeof(result) && (byte & 0x40) != 0)
- result |= -(1L << shift);
+ result |= -(((_Unwind_Word)1L) << shift);
*val = (_Unwind_Sword) result;
return p;