summaryrefslogtreecommitdiffstats
path: root/lldb/source/Expression/IRInterpreter.cpp
diff options
context:
space:
mode:
authorSean Callanan <scallanan@apple.com>2013-02-15 23:07:52 +0000
committerSean Callanan <scallanan@apple.com>2013-02-15 23:07:52 +0000
commitc8675507aac2b506bd49b09bf9ede36f554dc062 (patch)
tree649576dc26a7c67bcecd02ddc996662445b02bc4 /lldb/source/Expression/IRInterpreter.cpp
parent42d4e2e4eca8d7313fd975aec0200a3e34163901 (diff)
downloadbcm5719-llvm-c8675507aac2b506bd49b09bf9ede36f554dc062.tar.gz
bcm5719-llvm-c8675507aac2b506bd49b09bf9ede36f554dc062.zip
Fixes in the IRInterpreter:
- removed an unnecessary variable - fixed an issue where we sometimes wrote too much data into a buffer - made the recognition of variables as "this" a little more conservative <rdar://problem/13216268> llvm-svn: 175318
Diffstat (limited to 'lldb/source/Expression/IRInterpreter.cpp')
-rw-r--r--lldb/source/Expression/IRInterpreter.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/lldb/source/Expression/IRInterpreter.cpp b/lldb/source/Expression/IRInterpreter.cpp
index de3083283ec..18a92188a70 100644
--- a/lldb/source/Expression/IRInterpreter.cpp
+++ b/lldb/source/Expression/IRInterpreter.cpp
@@ -524,7 +524,7 @@ public:
if (!AssignToMatchType(cast_scalar, scalar.GetRawBits64(0), value->getType()))
return false;
- lldb_private::DataBufferHeap buf(cast_scalar.GetByteSize(), 0);
+ lldb_private::DataBufferHeap buf(region.m_extent, 0);
lldb_private::Error err;
@@ -534,8 +534,8 @@ public:
DataEncoderSP region_encoder = m_memory.GetEncoder(region);
if (buf.GetByteSize() > region_encoder->GetByteSize())
- return false; // TODO figure out why this happens; try "expr int i = 12; i"
-
+ return false; // This should not happen
+
memcpy(region_encoder->GetDataStart(), buf.GetBytes(), buf.GetByteSize());
return true;
@@ -665,9 +665,10 @@ public:
if (name_str == "this" ||
name_str == "self" ||
name_str == "_cmd")
+ {
resolved_value = m_decl_map.GetSpecialValue(lldb_private::ConstString(name_str.c_str()));
-
- variable_is_this = true;
+ variable_is_this = true;
+ }
}
if (resolved_value.GetScalar().GetType() != lldb_private::Scalar::e_void)
@@ -835,9 +836,7 @@ public:
// Fall back and allocate space [allocation type Alloca]
Type *type = value->getType();
-
- lldb::ValueSP backing_value(new lldb_private::Value);
-
+
Memory::Region data_region = m_memory.Malloc(type);
data_region.m_allocation->m_origin.GetScalar() = (unsigned long long)data_region.m_allocation->m_data->GetBytes();
data_region.m_allocation->m_origin.SetContext(lldb_private::Value::eContextTypeInvalid, NULL);
OpenPOWER on IntegriCloud