Skip to content

Commit a0341d9

Browse files
xal-0vtjnash
andauthored
Apply suggestions from code review
Co-authored-by: Jameson Nash <vtjnash@gmail.com>
1 parent f66b5bb commit a0341d9

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/dlload.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,7 @@ void *jl_find_dynamic_library_by_addr(void *symbol, int throw_err, int close) JL
256256
jl_error("could not load base module");
257257
return NULL;
258258
}
259+
dlerror();
259260
handle = dlopen(info.dli_fname, RTLD_NOW | RTLD_NOLOAD | RTLD_LOCAL);
260261
#if defined(_OS_FREEBSD_)
261262
// FreeBSD will not give you a handle for the executable if you dlopen() it
@@ -292,7 +293,7 @@ JL_DLLEXPORT void *jl_load_dynamic_library(const char *modname, unsigned flags,
292293

293294
// modname == NULL is a sentinel value requesting the handle of libjulia-internal
294295
if (modname == NULL)
295-
return jl_find_dynamic_library_by_addr(&jl_load_dynamic_library, throw_err, 1);
296+
return jl_libjulia_internal_handle;
296297

297298
abspath = jl_isabspath(modname);
298299
is_atpath = 0;

src/threading.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,7 @@ JL_DLLEXPORT jl_gcframe_t **jl_autoinit_and_adopt_thread(void)
461461
{
462462
if (!jl_is_initialized()) {
463463
void *retaddr = __builtin_extract_return_addr(__builtin_return_address(0));
464-
void *handle = jl_find_dynamic_library_by_addr(retaddr, 0, 1);
464+
void *handle = jl_find_dynamic_library_by_addr(retaddr, 0, 0);
465465
if (handle == NULL) {
466466
fprintf(stderr, "error: runtime auto-initialization failed due to bad sysimage lookup\n"
467467
" (this should not happen, please file a bug report)\n");

0 commit comments

Comments
 (0)