Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
wsmoses committed Dec 31, 2024
1 parent 960bc0f commit 1995456
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/rules/jitrules.jl
Original file line number Diff line number Diff line change
Expand Up @@ -817,7 +817,11 @@ function push_if_not_ref(
return darg
end

@inline function push_inner(@nospecialize(vals), @nospecialize(arg), @nospecialize(darg))
struct PushInnerStruct{Vals}
vals::Vals
end

@inline function (v::PushInnerStruct)(@nospecialize(arg), @nospecialize(darg))
ty = Core.Typeof(arg)
actreg = active_reg_nothrow(ty, Val(nothing))
if actreg == AnyState
Expand All @@ -828,7 +832,7 @@ end
darg = Base.inferencebarrier(darg)
MixedDuplicated(
arg,
push_if_not_ref(Val(reverse), vals, darg, ty)::Base.RefValue{ty},
push_if_not_ref(Val(reverse), v.vals, darg, ty)::Base.RefValue{ty},
)
else
Duplicated(arg, darg)
Expand All @@ -841,7 +845,7 @@ end
args,
dargs,
) where {reverse}
map(Base.Fix1(push_inner, vals), args, dargs)
map(PushInnerStruct(vals), args, dargs)
end

@inline function iterate_unwrap_augfwd_batchdup(
Expand Down

0 comments on commit 1995456

Please sign in to comment.