Fixed a crasher that occurs when an expression
doesn't return a result. If that expression can't
be run in the current context (for example, if it
uses a function and there is no running process)
then we used to try to destroy the nonexistent
result variable. We now only destroy the result
variable if we actually made one.
git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@155455 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/Expression/IRForTarget.cpp b/source/Expression/IRForTarget.cpp
index 8b2b119..fe826cf 100644
--- a/source/Expression/IRForTarget.cpp
+++ b/source/Expression/IRForTarget.cpp
@@ -2676,7 +2676,8 @@
}
if (m_execution_policy == lldb_private::eExecutionPolicyNever) {
- m_decl_map->RemoveResultVariable(m_result_name);
+ if (m_result_name)
+ m_decl_map->RemoveResultVariable(m_result_name);
return false;
}