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:
Greg Clayton 2016-06-28 17:14:18 +00:00
parent 85de98fd24
commit d781d2c9b7
3 changed files with 5 additions and 5 deletions

View File

@ -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;

View File

@ -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;

View File

@ -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;