From 5c1b4fe06dd2b1a96b94a6859c9ed4d892086fad Mon Sep 17 00:00:00 2001 From: Jameson Nash Date: Fri, 14 Mar 2025 19:30:16 +0000 Subject: [PATCH] loading: fix ccall signature in _include_from_serialized This still sort of errored correctly anyways (after breakage added from PR #56499), but that behavior should not be relied upon optimizations not breaking it when this is providing incorrect info to the compiler. Fix #57459 --- base/loading.jl | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/base/loading.jl b/base/loading.jl index 3f5ba46906e3e..c7397df8f4515 100644 --- a/base/loading.jl +++ b/base/loading.jl @@ -1280,17 +1280,21 @@ function _include_from_serialized(pkg::PkgId, path::String, ocachepath::Union{No sv = try if ocachepath !== nothing @debug "Loading object cache file $ocachepath for $(repr("text/plain", pkg))" - ccall(:jl_restore_package_image_from_file, Ref{SimpleVector}, (Cstring, Any, Cint, Cstring, Cint), + ccall(:jl_restore_package_image_from_file, Any, (Cstring, Any, Cint, Cstring, Cint), ocachepath, depmods, #=completeinfo=#false, pkg.name, ignore_native) else @debug "Loading cache file $path for $(repr("text/plain", pkg))" - ccall(:jl_restore_incremental, Ref{SimpleVector}, (Cstring, Any, Cint, Cstring), + ccall(:jl_restore_incremental, Any, (Cstring, Any, Cint, Cstring), path, depmods, #=completeinfo=#false, pkg.name) end finally lock(require_lock) end + if isa(sv, Exception) + return sv + end + sv = sv::SimpleVector edges = sv[3]::Vector{Any} ext_edges = sv[4]::Union{Nothing,Vector{Any}} extext_methods = sv[5]::Vector{Any}