summaryrefslogtreecommitdiffstats
path: root/lldb/source/Expression/REPL.cpp
diff options
context:
space:
mode:
authorAdrian Prantl <aprantl@apple.com>2020-01-08 14:18:47 -0800
committerAdrian Prantl <aprantl@apple.com>2020-01-10 08:52:46 -0800
commite9331a56fead1823d528d6412828fb9e16fd62ff (patch)
tree0532d62035494c012cd196e24065418c6eed7c62 /lldb/source/Expression/REPL.cpp
parentbdd88b7ed3956534a0a71b1ea2bc88c69d48f9b7 (diff)
downloadbcm5719-llvm-e9331a56fead1823d528d6412828fb9e16fd62ff.tar.gz
bcm5719-llvm-e9331a56fead1823d528d6412828fb9e16fd62ff.zip
Add missing nullptr checks.
GetPersistentExpressionStateForLanguage() can return a nullptr if it cannot construct a typesystem. This patch adds missing nullptr checks at all uses. Inspired by rdar://problem/58317195 Differential Revision: https://reviews.llvm.org/D72413
Diffstat (limited to 'lldb/source/Expression/REPL.cpp')
-rw-r--r--lldb/source/Expression/REPL.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/lldb/source/Expression/REPL.cpp b/lldb/source/Expression/REPL.cpp
index 4f81ee3e56d..fcd08368473 100644
--- a/lldb/source/Expression/REPL.cpp
+++ b/lldb/source/Expression/REPL.cpp
@@ -283,6 +283,8 @@ void REPL::IOHandlerInputComplete(IOHandler &io_handler, std::string &code) {
PersistentExpressionState *persistent_state =
m_target.GetPersistentExpressionStateForLanguage(GetLanguage());
+ if (!persistent_state)
+ return;
const size_t var_count_before = persistent_state->GetSize();
OpenPOWER on IntegriCloud