aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Interpreter/Interpreter.cpp
diff options
context:
space:
mode:
authorSahilPatidar <patidarsahil2001@gmail.com>2024-12-10 13:27:31 +0530
committerGitHub <noreply@github.com>2024-12-10 09:57:31 +0200
commit30ad53b92cec0cff9679d559edcc5b933312ba0c (patch)
tree431b4e9c0eb0517c8e7b3ac2c6bc4a353115d0a3 /clang/lib/Interpreter/Interpreter.cpp
parent37913233430865aa16591a710f9440f3260b0827 (diff)
downloadllvm-30ad53b92cec0cff9679d559edcc5b933312ba0c.zip
llvm-30ad53b92cec0cff9679d559edcc5b933312ba0c.tar.gz
llvm-30ad53b92cec0cff9679d559edcc5b933312ba0c.tar.bz2
[Clang-REPL] Fix crash during `__run_exit_handlers` with dynamic libraries. (#117475)
Apply the fix suggested by Lang Hames to address a crash in Clang-REPL that occurs during the execution of `__run_exit_handlers` when using dynamic libraries.
Diffstat (limited to 'clang/lib/Interpreter/Interpreter.cpp')
-rw-r--r--clang/lib/Interpreter/Interpreter.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/clang/lib/Interpreter/Interpreter.cpp b/clang/lib/Interpreter/Interpreter.cpp
index fa4c143..6cd60a9b 100644
--- a/clang/lib/Interpreter/Interpreter.cpp
+++ b/clang/lib/Interpreter/Interpreter.cpp
@@ -719,7 +719,9 @@ llvm::Error Interpreter::LoadDynamicLibrary(const char *name) {
if (auto DLSG = llvm::orc::DynamicLibrarySearchGenerator::Load(
name, DL.getGlobalPrefix()))
- EE->getMainJITDylib().addGenerator(std::move(*DLSG));
+ // FIXME: Eventually we should put each library in its own JITDylib and
+ // turn off process symbols by default.
+ EE->getProcessSymbolsJITDylib()->addGenerator(std::move(*DLSG));
else
return DLSG.takeError();