Skip to content

Commit

Permalink
[cli/loader]: Don't allow initialization to run more than once
Browse files Browse the repository at this point in the history
There are multiple ways of fixing this, but let's just not let
trampolines get re-set after they've already been set.
  • Loading branch information
staticfloat committed Dec 30, 2020
1 parent b26a386 commit 8981e0b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cli/loader_lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,11 @@ JL_DLLEXPORT const char * jl_get_libdir()

void * libjulia_internal = NULL;
__attribute__((constructor)) void jl_load_libjulia_internal(void) {
// Only initalize this once
if (libjulia_internal != NULL) {
return;
}

// Introspect to find our own path
const char * lib_dir = jl_get_libdir();

Expand Down

0 comments on commit 8981e0b

Please sign in to comment.