Skip to content

Commit

Permalink
Add a missing guard in multi deferral
Browse files Browse the repository at this point in the history
The callsame guard only cared for the types of the arguments, but not
the particular target multi. (Eventually this should be resolved by us
arranging to attach the dispatch caches for `callsame` and friends a
level up, but for now this gets us correct behavior.)
  • Loading branch information
jnthn committed Sep 6, 2021
1 parent 3a35149 commit 2471aa1
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/vm/moar/dispatchers.nqp
Expand Up @@ -1971,6 +1971,13 @@ nqp::dispatch('boot-syscall', 'dispatcher-register', 'raku-multi-core',
my $arg-capture := nqp::dispatch('boot-syscall', 'dispatcher-drop-arg', $init, 0);
my $dispatch-plan := raku-multi-plan(@candidates, $arg-capture, 0);

# Put a guard on the dispatchees.
my $track-target := nqp::dispatch('boot-syscall', 'dispatcher-track-arg',
$init, 0);
nqp::dispatch('boot-syscall', 'dispatcher-guard-literal',
nqp::dispatch('boot-syscall', 'dispatcher-track-attr',
$track-target, Routine, '@!dispatchees'));

# We already called the first candidate in the trivial plan, so
# drop it.
$dispatch-plan := $dispatch-plan.next;
Expand All @@ -1987,8 +1994,6 @@ nqp::dispatch('boot-syscall', 'dispatcher-register', 'raku-multi-core',
$args := nqp::dispatch('boot-syscall', 'dispatcher-insert-arg',
$args, 0, $track-invocant);
}
my $track-target := nqp::dispatch('boot-syscall', 'dispatcher-track-arg',
$init, 0);
my $with-target := nqp::dispatch('boot-syscall', 'dispatcher-insert-arg',
$args, 0, $track-target);
my $capture-with-plan := nqp::dispatch('boot-syscall',
Expand Down

0 comments on commit 2471aa1

Please sign in to comment.