From def1210492c9467381beccd2ebefc755f107a507 Mon Sep 17 00:00:00 2001 From: chengchingwen Date: Tue, 5 Nov 2024 13:04:31 +0800 Subject: [PATCH 1/2] set codeinfo.isva/nargs for julia v1.12 --- src/cache.jl | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/cache.jl b/src/cache.jl index 76184fb..a5acef8 100644 --- a/src/cache.jl +++ b/src/cache.jl @@ -23,6 +23,14 @@ function __cacheget_generator__(world, source, self, cache, x, args #= for `retu Expr(Symbol("scope-block"), Expr(:block, Expr(:meta, :inline), Expr(:return, body)))) ci = ccall(:jl_expand, Any, (Any, Any), expr, @__MODULE__) ci.inlineable = true + if hasfield(CodeInfo, :nargs) + ci.nargs = 4 + ci.isva = true + end + if isdefined(Base, :__has_internal_change) && Base.__has_internal_change(v"1.12-alpha", :codeinfonargs) + ci.nargs = 4 + ci.isva = true + end return ci end From b729e36a1188232511371e1c9ba15cbd813b786e Mon Sep 17 00:00:00 2001 From: chengchingwen Date: Tue, 5 Nov 2024 13:10:36 +0800 Subject: [PATCH 2/2] core.codeinfo --- src/cache.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cache.jl b/src/cache.jl index a5acef8..fd6bc8f 100644 --- a/src/cache.jl +++ b/src/cache.jl @@ -23,7 +23,7 @@ function __cacheget_generator__(world, source, self, cache, x, args #= for `retu Expr(Symbol("scope-block"), Expr(:block, Expr(:meta, :inline), Expr(:return, body)))) ci = ccall(:jl_expand, Any, (Any, Any), expr, @__MODULE__) ci.inlineable = true - if hasfield(CodeInfo, :nargs) + if hasfield(Core.CodeInfo, :nargs) ci.nargs = 4 ci.isva = true end