Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't use internal jl_set_const to create constants #125

Merged
merged 1 commit into from
Jan 26, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions src/clusterserialize.jl
Original file line number Diff line number Diff line change
Expand Up @@ -167,10 +167,15 @@ function deserialize_global_from_main(s::ClusterSerializer, sym)
return nothing
end
end
Core.eval(Main, Expr(:global, sym))
if sym_isconst
ccall(:jl_set_const, Cvoid, (Any, Any, Any), Main, sym, v)
# Note that the post-lowering const form is not allowed in value
# position, so there needs to be a dummy `nothing` argument to drop the
# return value.
Core.eval(Main, Expr(:block,
Expr(:const, GlobalRef(Main, sym), v),
nothing))
JamesWrigley marked this conversation as resolved.
Show resolved Hide resolved
else
Core.eval(Main, Expr(:global, sym))
invokelatest(setglobal!, Main, sym, v)
end
return nothing
Expand Down
Loading