Skip to content

Commit 6cbed31

Browse files
authored
staticdata: fix assert from partially disabled native code (#53439)
This should fix the assertion failure that has been plaguing the Pkg tests, as discussed in #52123 (comment)
1 parent 923fe2d commit 6cbed31

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/staticdata.c

+5-2
Original file line numberDiff line numberDiff line change
@@ -3768,8 +3768,11 @@ JL_DLLEXPORT jl_value_t *jl_restore_package_image_from_file(const char *fname, j
37683768

37693769
jl_image_t pkgimage = jl_init_processor_pkgimg(pkgimg_handle);
37703770

3771-
if (ignore_native){
3772-
memset(&pkgimage.fptrs, 0, sizeof(pkgimage.fptrs));
3771+
if (ignore_native) {
3772+
// Must disable using native code in possible downstream users of this code:
3773+
// https://github.com/JuliaLang/julia/pull/52123#issuecomment-1959965395.
3774+
// The easiest way to do that is to disable it in all of them.
3775+
jl_options.use_sysimage_native_code = JL_OPTIONS_USE_SYSIMAGE_NATIVE_CODE_NO;
37733776
}
37743777

37753778
jl_value_t* mod = jl_restore_incremental_from_buf(pkgimg_handle, pkgimg_data, &pkgimage, *plen, depmods, completeinfo, pkgname, 0);

0 commit comments

Comments
 (0)