aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/ExecutionEngine/Orc/EPCDebugObjectRegistrar.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/ExecutionEngine/Orc/EPCDebugObjectRegistrar.cpp')
-rw-r--r--llvm/lib/ExecutionEngine/Orc/EPCDebugObjectRegistrar.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/llvm/lib/ExecutionEngine/Orc/EPCDebugObjectRegistrar.cpp b/llvm/lib/ExecutionEngine/Orc/EPCDebugObjectRegistrar.cpp
index 9f7d517..08bef37 100644
--- a/llvm/lib/ExecutionEngine/Orc/EPCDebugObjectRegistrar.cpp
+++ b/llvm/lib/ExecutionEngine/Orc/EPCDebugObjectRegistrar.cpp
@@ -42,7 +42,12 @@ Expected<std::unique_ptr<EPCDebugObjectRegistrar>> createJITLoaderGDBRegistrar(
assert((*Result)[0].size() == 1 &&
"Unexpected number of addresses in result");
- ExecutorAddr RegisterAddr = (*Result)[0][0].getAddress();
+ if (!(*Result)[0][0].has_value())
+ return make_error<StringError>(
+ "Expected a valid address in the lookup result",
+ inconvertibleErrorCode());
+
+ ExecutorAddr RegisterAddr = (*Result)[0][0]->getAddress();
return std::make_unique<EPCDebugObjectRegistrar>(ES, RegisterAddr);
}