Hardened the process of reading the program counter
on behalf of a DWARF expression.
git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@152477 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/Expression/DWARFExpression.cpp b/source/Expression/DWARFExpression.cpp
index 88ce130..1ff6e8e 100644
--- a/source/Expression/DWARFExpression.cpp
+++ b/source/Expression/DWARFExpression.cpp
@@ -1219,7 +1219,12 @@
else
{
frame = exe_ctx->GetFramePtr();
- pc = frame->GetRegisterContext()->GetPC();
+ if (!frame)
+ return false;
+ RegisterContextSP reg_ctx_sp = frame->GetRegisterContext();
+ if (!reg_ctx_sp)
+ return false;
+ pc = reg_ctx_sp->GetPC();
}
if (loclist_base_load_addr != LLDB_INVALID_ADDRESS)