Skip to content

Commit db2f538

Browse files
committed
Reset the error handler before installing a new one.
Module finalizers (JuliaLang/julia#8764) would be a better option here.
1 parent e16993a commit db2f538

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/core/context.jl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,5 +98,10 @@ end
9898

9999
function _install_handlers()
100100
handler = cfunction(handle_error, Void, Tuple{Cstring})
101+
102+
# NOTE: LLVM doesn't support re-installing the error handler, which happens when we
103+
# `reload("LLVM")`, so reset it instead. This isn't correct, as the installed
104+
# handler might not have been ours. Ideally we'd have module finalizers...
105+
API.LLVMResetFatalErrorHandler()
101106
API.LLVMInstallFatalErrorHandler(handler)
102107
end

0 commit comments

Comments
 (0)