diff options
author | Jan Hubicka <jh@suse.cz> | 2003-12-08 20:47:12 +0100 |
---|---|---|
committer | Jan Hubicka <hubicka@gcc.gnu.org> | 2003-12-08 19:47:12 +0000 |
commit | f167b1c037e35205c64116d8ec4e55401ae8af18 (patch) | |
tree | bd2979b87b531da386bad46620e258928d3af7ef /gcc/unwind-pe.h | |
parent | 32b32b1606957e44b781af2de35eb5ab0a8ac4d4 (diff) | |
download | gcc-f167b1c037e35205c64116d8ec4e55401ae8af18.tar.gz |
unwind-pe.h (read_uleb128): Fix handling of large values
* unwind-pe.h (read_uleb128): Fix handling of large values
(read_sleb128): Fix handling of large values
From-SVN: r74429
Diffstat (limited to 'gcc/unwind-pe.h')
-rw-r--r-- | gcc/unwind-pe.h | 6 |
1 files changed, 3 insertions, 3 deletions
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; |