@@ -84,11 +84,13 @@ function build_callable(sig::Type{<:Tuple})
8484 return fresh_copy (mc_cache[key])
8585 else
8686 ir = Base. code_ircode_by_type (sig)[1 ][1 ]
87+ # Check whether this is a varargs call.
88+ isva = which (sig). isva
8789 bb, refs, types = derive_copyable_task_ir (BBCode (ir))
8890 unoptimised_ir = IRCode (bb)
8991 optimised_ir = optimise_ir! (unoptimised_ir)
9092 mc_ret_type = callable_ret_type (sig, types)
91- mc = misty_closure (mc_ret_type, optimised_ir, refs... ; do_compile= true )
93+ mc = misty_closure (mc_ret_type, optimised_ir, refs... ; isva = isva, do_compile= true )
9294 mc_cache[key] = mc
9395 return mc, refs[end ]
9496 end
315317"""
316318 set_taped_globals!(t::TapedTask, new_taped_globals)::Nothing
317319
318- Set the `taped_globals` of `t` to `new_taped_globals`. Any calls to
320+ Set the `taped_globals` of `t` to `new_taped_globals`. Any calls to
319321[`get_taped_globals`](@ref) in future calls to `consume(t)` (either directly, or implicitly
320322via iteration) will see this new value.
321323"""
@@ -573,7 +575,7 @@ function derive_copyable_task_ir(ir::BBCode)::Tuple{BBCode,Tuple,Vector{Any}}
573575 # We enforced above the condition that the final statement in a basic block must not
574576 # produce. This ensures that the final split does not produce. While not strictly
575577 # necessary, this simplifies the implementation (see below).
576- #
578+ #
577579 # As a result of the above, a basic block will be associated to exactly one split if it
578580 # does not contain any statements which may produce.
579581 #
@@ -595,7 +597,7 @@ function derive_copyable_task_ir(ir::BBCode)::Tuple{BBCode,Tuple,Vector{Any}}
595597 # Owing to splitting blocks up, we will need to re-label some `GotoNode`s and
596598 # `GotoIfNot`s. To understand this, consider the following block, whose original `ID`
597599 # we assume to be `ID(old_id)`.
598- # ID(new_id) - %1 = φ(ID(3) => ...)
600+ # ID(new_id) - %1 = φ(ID(3) => ...)
599601 # ID(new_id) - %3 = call_which_must_not_produce(...)
600602 # ID(new_id) - %4 = produce(%3)
601603 # ID(old_id) - GotoNode(ID(5))
0 commit comments