[Lldb-commits] [lldb] r274037 - 64-bit LEB values are not always correctly decoded due to a casting issue, now they are.
Greg Clayton via lldb-commits
lldb-commits at lists.llvm.org
Tue Jun 28 10:14:19 PDT 2016
Author: gclayton
Date: Tue Jun 28 12:14:18 2016
New Revision: 274037
URL: http://llvm.org/viewvc/llvm-project?rev=274037&view=rev
Log:
64-bit LEB values are not always correctly decoded due to a casting issue, now they are.
<rdar://problem/27002247>
Modified:
lldb/trunk/source/Core/DataExtractor.cpp
lldb/trunk/source/Symbol/ArmUnwindInfo.cpp
lldb/trunk/tools/debugserver/source/DNBDataRef.cpp
Modified: lldb/trunk/source/Core/DataExtractor.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/DataExtractor.cpp?rev=274037&r1=274036&r2=274037&view=diff
==============================================================================
--- lldb/trunk/source/Core/DataExtractor.cpp (original)
+++ lldb/trunk/source/Core/DataExtractor.cpp Tue Jun 28 12:14:18 2016
@@ -1237,7 +1237,7 @@ DataExtractor::GetULEB128 (offset_t *off
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 *off
{
bytecount++;
byte = *src++;
- result |= (byte & 0x7f) << shift;
+ result |= (int64_t)(byte & 0x7f) << shift;
shift += 7;
if ((byte & 0x80) == 0)
break;
Modified: lldb/trunk/source/Symbol/ArmUnwindInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/ArmUnwindInfo.cpp?rev=274037&r1=274036&r2=274037&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/ArmUnwindInfo.cpp (original)
+++ lldb/trunk/source/Symbol/ArmUnwindInfo.cpp Tue Jun 28 12:14:18 2016
@@ -103,7 +103,7 @@ ArmUnwindInfo::GetULEB128(const uint32_t
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;
Modified: lldb/trunk/tools/debugserver/source/DNBDataRef.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/DNBDataRef.cpp?rev=274037&r1=274036&r2=274037&view=diff
==============================================================================
--- lldb/trunk/tools/debugserver/source/DNBDataRef.cpp (original)
+++ lldb/trunk/tools/debugserver/source/DNBDataRef.cpp Tue Jun 28 12:14:18 2016
@@ -250,7 +250,7 @@ DNBDataRef::Get_ULEB128 (offset_t *offse
{
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 *offse
{
bytecount++;
byte = *src++;
- result |= (byte & 0x7f) << shift;
+ result |= (int64_t)(byte & 0x7f) << shift;
shift += 7;
if ((byte & 0x80) == 0)
break;
More information about the lldb-commits
mailing list