Skip to content

Commit

Permalink
Fix exception when mixing in roles that use is built at runtime
Browse files Browse the repository at this point in the history
In this case, Metamodel::BUILDPLAN.create_BUILDPLAN would attempt to
look up Mu through $*W when it no longer exists. Instead, HLLize a
VMNull to get it.
  • Loading branch information
Kaiepi committed Mar 21, 2020
1 parent 8fe30b9 commit 4c026ab
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/Perl6/Metamodel/BUILDPLAN.nqp
Expand Up @@ -112,7 +112,10 @@ role Perl6::Metamodel::BUILDPLAN {
# binding may need type info for runtime checks
if $action == 13 {
my $type := $_.type;
unless $type =:= $*W.find_symbol(["Mu"]) {
# since we may wind up here at runtime, get Mu by
# HLLizing a VMNull instead of looking it up through
# $*W
unless $type =:= nqp::hllizefor(nqp::null(), 'Raku') {
nqp::push($info,$type);
}
}
Expand Down Expand Up @@ -196,9 +199,11 @@ role Perl6::Metamodel::BUILDPLAN {
}

# add type if we need to check at runtime
# since we may wind up here at runtime, get Mu by HLLizing
# a VMNull instead of looking it up through $*W
nqp::push(@action,$type)
if $check-at-runtime
&& !nqp::eqaddr($type,$*W.find_symbol(["Mu"]));
&& !nqp::eqaddr($type,nqp::hllizefor(nqp::null(), 'Raku'));

# store the action, mark as seen
nqp::push(@plan,@action);
Expand Down

0 comments on commit 4c026ab

Please sign in to comment.