diff options
| author | Sean Callanan <scallanan@apple.com> | 2012-01-05 01:11:09 +0000 |
|---|---|---|
| committer | Sean Callanan <scallanan@apple.com> | 2012-01-05 01:11:09 +0000 |
| commit | 31a8d051ddc88fb654ad676ffa0a90bb6decb0c8 (patch) | |
| tree | 5e15ba71cdc38a25bd57985f3c385d6bea7ea656 /lldb/source/Core/ValueObjectConstResult.cpp | |
| parent | 78d87d3b4b8eb0402af4d6a775fa5cf91190f847 (diff) | |
| download | bcm5719-llvm-31a8d051ddc88fb654ad676ffa0a90bb6decb0c8.tar.gz bcm5719-llvm-31a8d051ddc88fb654ad676ffa0a90bb6decb0c8.zip | |
Fixed a dangling pointer bug associated with the
result variable on a "finish" statement. The
ownership of the result value was not being properly
assigned to the newly-created persistent result
variable; now it is.
llvm-svn: 147587
Diffstat (limited to 'lldb/source/Core/ValueObjectConstResult.cpp')
| -rw-r--r-- | lldb/source/Core/ValueObjectConstResult.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lldb/source/Core/ValueObjectConstResult.cpp b/lldb/source/Core/ValueObjectConstResult.cpp index 950d33405af..ee82e24980f 100644 --- a/lldb/source/Core/ValueObjectConstResult.cpp +++ b/lldb/source/Core/ValueObjectConstResult.cpp @@ -98,6 +98,13 @@ ValueObjectConstResult::ValueObjectConstResult m_impl(this, address) { m_data = data; + + if (!m_data.GetSharedDataBuffer()) + { + DataBufferSP shared_data_buffer(new DataBufferHeap(data.GetDataStart(), data.GetByteSize())); + m_data.SetData(shared_data_buffer); + } + m_value.GetScalar() = (uintptr_t)m_data.GetDataStart(); m_value.SetValueType(Value::eValueTypeHostAddress); m_value.SetContext(Value::eContextTypeClangType, clang_type); |

