Skip to content

Commit 18af616

Browse files
committed
We cannot dereference the object if it had an error.
This patch fixes several asserts in clang-repl mode.
1 parent 0cf830a commit 18af616

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/Interpreter/CppInterOp.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -913,9 +913,9 @@ namespace Cpp {
913913
auto FDAorErr =
914914
compat::getSymbolAddress(*I, StringRef(get_mangled_name(FD)));
915915
if (llvm::Error Err = FDAorErr.takeError())
916-
llvm::logAllUnhandledErrors(std::move(Err), llvm::errs(),
917-
"Failed to GetFunctionAdress:");
918-
return llvm::jitTargetAddressToPointer<void *>(*FDAorErr);
916+
llvm::logAllUnhandledErrors(std::move(Err), llvm::errs(), "Failed to GetFunctionAdress:");
917+
else
918+
return llvm::jitTargetAddressToPointer<void*>(*FDAorErr);
919919
}
920920

921921
return 0;

0 commit comments

Comments
 (0)