Don't try to actually run code when the expression is top-level.

llvm-svn: 264660
This commit is contained in:
Sean Callanan 2016-03-28 21:10:36 +00:00
parent 38167d2536
commit 2ff00003f1
1 changed files with 5 additions and 0 deletions

View File

@ -281,6 +281,11 @@ UserExpression::Evaluate (ExecutionContext &exe_ctx,
if (!diagnostic_manager.Diagnostics().size())
error.SetExpressionError(lldb::eExpressionSetupError, "expression needed to run but couldn't");
}
else if (execution_policy == eExecutionPolicyTopLevel)
{
error.SetError(UserExpression::kNoResult, lldb::eErrorTypeGeneric);
return lldb::eExpressionCompleted;
}
else
{
if (options.InvokeCancelCallback (lldb::eExpressionEvaluationExecution))