Skip to content

Commit

Permalink
staticdata: fix assert from partially disabled native code (JuliaLang…
Browse files Browse the repository at this point in the history
…#53439)

This should fix the assertion failure that has been plaguing the Pkg
tests, as discussed in JuliaLang#52123 (comment)
  • Loading branch information
vtjnash authored and tecosaur committed Mar 4, 2024
1 parent 8301f7a commit 61de2cb
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/staticdata.c
Original file line number Diff line number Diff line change
Expand Up @@ -3768,8 +3768,11 @@ JL_DLLEXPORT jl_value_t *jl_restore_package_image_from_file(const char *fname, j

jl_image_t pkgimage = jl_init_processor_pkgimg(pkgimg_handle);

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

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

0 comments on commit 61de2cb

Please sign in to comment.