Skip to content

Commit

Permalink
Fix invoke handling in generate_builtins.jl
Browse files Browse the repository at this point in the history
  • Loading branch information
timholy committed Jul 24, 2022
1 parent a47c962 commit 83a48ca
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions bin/generate_builtins.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const RECENTLY_ADDED = Core.Builtin[
Core.get_binding_type, Core.set_binding_type!,
Core.getglobal, Core.setglobal!,
Core.modifyfield!, Core.replacefield!, Core.swapfield!,
]
]
const kwinvoke = Core.kwfunc(Core.invoke)

function scopedname(f)
Expand Down Expand Up @@ -175,11 +175,13 @@ function maybe_evaluate_builtin(frame, call_expr, expand::Bool)
print(io,
"""
$head f === $fstr
argswrapped = getargs(args, frame)
if !expand
argswrapped = getargs(args, frame)
return Some{Any}($fstr(argswrapped...))
end
return Expr(:call, $fstr, argswrapped...)
# This uses the original arguments to avoid looking them up twice
# See #442
return Expr(:call, invoke, args[2:end]...)
""")
continue
elseif f === Core._call_latest
Expand Down

0 comments on commit 83a48ca

Please sign in to comment.