Added checking to make sure that the target has a
scratch AST context before attempting to parse.
git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@136631 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/Expression/ClangUtilityFunction.cpp b/source/Expression/ClangUtilityFunction.cpp
index aec3088..72c6888 100644
--- a/source/Expression/ClangUtilityFunction.cpp
+++ b/source/Expression/ClangUtilityFunction.cpp
@@ -103,7 +103,11 @@
m_data_allocator.reset(new ProcessDataAllocator(*exe_ctx.process));
- m_expr_decl_map->WillParse(exe_ctx);
+ if (!m_expr_decl_map->WillParse(exe_ctx))
+ {
+ error_stream.PutCString ("error: current process state is unsuitable for expression parsing\n");
+ return false;
+ }
ClangExpressionParser parser(exe_ctx.GetBestExecutionContextScope(), *this);