Skip to content

Commit 8981e0b

Browse files
committed
[cli/loader]: Don't allow initialization to run more than once
There are multiple ways of fixing this, but let's just not let trampolines get re-set after they've already been set.
1 parent b26a386 commit 8981e0b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

cli/loader_lib.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,11 @@ JL_DLLEXPORT const char * jl_get_libdir()
130130

131131
void * libjulia_internal = NULL;
132132
__attribute__((constructor)) void jl_load_libjulia_internal(void) {
133+
// Only initalize this once
134+
if (libjulia_internal != NULL) {
135+
return;
136+
}
137+
133138
// Introspect to find our own path
134139
const char * lib_dir = jl_get_libdir();
135140

0 commit comments

Comments
 (0)