From: Sean Callanan Date: Fri, 15 Feb 2013 23:07:52 +0000 (+0000) Subject: Fixes in the IRInterpreter: X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c8675507aac2b506bd49b09bf9ede36f554dc062;p=platform%2Fupstream%2Fllvm.git 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 llvm-svn: 175318 --- diff --git a/lldb/source/Expression/IRInterpreter.cpp b/lldb/source/Expression/IRInterpreter.cpp index de30832..18a9218 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);