Skip to content

Commit

Permalink
fix precompile(::MethodInstance) ccall signature (#56595)
Browse files Browse the repository at this point in the history
Prevents calling this method from triggering undefined behavior in C

(cherry picked from commit b6eeef2)
  • Loading branch information
vtjnash authored and KristofferC committed Nov 22, 2024
1 parent 229f027 commit 580b2b8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion base/loading.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4027,7 +4027,7 @@ end

# Variants that work for `invoke`d calls for which the signature may not be sufficient
precompile(mi::Core.MethodInstance, world::UInt=get_world_counter()) =
(ccall(:jl_compile_method_instance, Cvoid, (Any, Any, UInt), mi, C_NULL, world); return true)
(ccall(:jl_compile_method_instance, Cvoid, (Any, Ptr{Cvoid}, UInt), mi, C_NULL, world); return true)

"""
precompile(f, argtypes::Tuple{Vararg{Any}}, m::Method)
Expand Down

0 comments on commit 580b2b8

Please sign in to comment.