[clang] [Clang-REPL] Fix crash during `__run_exit_handlers` with dynamic libraries. (PR #117475)
via cfe-commits
cfe-commits at lists.llvm.org
Sun Nov 24 02:43:20 PST 2024
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-clang
Author: None (SahilPatidar)
<details>
<summary>Changes</summary>
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.
---
Full diff: https://github.com/llvm/llvm-project/pull/117475.diff
1 Files Affected:
- (modified) clang/lib/Interpreter/Interpreter.cpp (+3-1)
``````````diff
diff --git a/clang/lib/Interpreter/Interpreter.cpp b/clang/lib/Interpreter/Interpreter.cpp
index 5dc67f6375098f..71299f7176e2fe 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();
``````````
</details>
https://github.com/llvm/llvm-project/pull/117475
More information about the cfe-commits
mailing list