diff options
author | Sean Callanan <scallanan@apple.com> | 2013-05-22 22:49:06 +0000 |
---|---|---|
committer | Sean Callanan <scallanan@apple.com> | 2013-05-22 22:49:06 +0000 |
commit | fbf5c682cbfce539bba2de06456cd6afcf8c892f (patch) | |
tree | 64969f94fd7116f6d881f896bddc219f83c12036 /lldb/source/Expression/Materializer.cpp | |
parent | 682ae15bb92fb05a2fbb7b58a550adffb8538137 (diff) | |
download | llvm-fbf5c682cbfce539bba2de06456cd6afcf8c892f.zip llvm-fbf5c682cbfce539bba2de06456cd6afcf8c892f.tar.gz llvm-fbf5c682cbfce539bba2de06456cd6afcf8c892f.tar.bz2 |
Fixed a bug where persistent variables did not
live as long as they needed to. This led to
equality tests involving persistent variables
often failing or succeeding when they had no
business doing so.
To do this, I introduced the ability for a
memory allocation to "leak" - that is, to
persist in the process beyond the lifetime of
the expression. Hand-declared persistent
variables do this now.
<rdar://problem/13956311>
llvm-svn: 182528
Diffstat (limited to 'lldb/source/Expression/Materializer.cpp')
-rw-r--r-- | lldb/source/Expression/Materializer.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lldb/source/Expression/Materializer.cpp b/lldb/source/Expression/Materializer.cpp index f41a613..897065f 100644 --- a/lldb/source/Expression/Materializer.cpp +++ b/lldb/source/Expression/Materializer.cpp @@ -109,7 +109,11 @@ public: // Clear the flag if the variable will never be deallocated. if (m_persistent_variable_sp->m_flags & ClangExpressionVariable::EVKeepInTarget) + { + Error leak_error; + map.Leak(mem, leak_error); m_persistent_variable_sp->m_flags &= ~ClangExpressionVariable::EVNeedsAllocation; + } // Write the contents of the variable to the area. |