forked from OSchip/llvm-project
64-bit LEB values are not always correctly decoded due to a casting issue, now they are.
<rdar://problem/27002247> llvm-svn: 274037
This commit is contained in:
parent
85de98fd24
commit
d781d2c9b7
|
@ -1237,7 +1237,7 @@ DataExtractor::GetULEB128 (offset_t *offset_ptr) const
|
|||
while (src < end)
|
||||
{
|
||||
uint8_t byte = *src++;
|
||||
result |= (byte & 0x7f) << shift;
|
||||
result |= (uint64_t)(byte & 0x7f) << shift;
|
||||
if ((byte & 0x80) == 0)
|
||||
break;
|
||||
shift += 7;
|
||||
|
@ -1280,7 +1280,7 @@ DataExtractor::GetSLEB128 (offset_t *offset_ptr) const
|
|||
{
|
||||
bytecount++;
|
||||
byte = *src++;
|
||||
result |= (byte & 0x7f) << shift;
|
||||
result |= (int64_t)(byte & 0x7f) << shift;
|
||||
shift += 7;
|
||||
if ((byte & 0x80) == 0)
|
||||
break;
|
||||
|
|
|
@ -103,7 +103,7 @@ ArmUnwindInfo::GetULEB128(const uint32_t* data, uint16_t& offset, uint16_t max_o
|
|||
while (offset < max_offset)
|
||||
{
|
||||
uint8_t byte = GetByteAtOffset(data, offset++);
|
||||
result |= (byte & 0x7f) << shift;
|
||||
result |= (uint64_t)(byte & 0x7f) << shift;
|
||||
if ((byte & 0x80) == 0)
|
||||
break;
|
||||
shift += 7;
|
||||
|
|
|
@ -250,7 +250,7 @@ DNBDataRef::Get_ULEB128 (offset_t *offset_ptr) const
|
|||
{
|
||||
bytecount++;
|
||||
byte = *src++;
|
||||
result |= (byte & 0x7f) << shift;
|
||||
result |= (uint64_t)(byte & 0x7f) << shift;
|
||||
shift += 7;
|
||||
if ((byte & 0x80) == 0)
|
||||
break;
|
||||
|
@ -283,7 +283,7 @@ DNBDataRef::Get_SLEB128 (offset_t *offset_ptr) const
|
|||
{
|
||||
bytecount++;
|
||||
byte = *src++;
|
||||
result |= (byte & 0x7f) << shift;
|
||||
result |= (int64_t)(byte & 0x7f) << shift;
|
||||
shift += 7;
|
||||
if ((byte & 0x80) == 0)
|
||||
break;
|
||||
|
|
Loading…
Reference in New Issue