Skip to content

Commit

Permalink
Make PseudoStash from CORE.setting conform to pre-6.e state
Browse files Browse the repository at this point in the history
I.e. CORE:: must always point at CORE.setting and be of PRECISE_SCOPE
  • Loading branch information
vrurg committed Jul 17, 2019
1 parent 0e82bf3 commit 43582f5
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/core/PseudoStash.pm6
Expand Up @@ -32,7 +32,12 @@ my class PseudoStash is Map {
},
'CORE', sub ($cur) {
my Mu $ctx := nqp::getattr(nqp::decont($cur), PseudoStash, '$!ctx');
until nqp::isnull($ctx) || nqp::existskey(nqp::ctxlexpad($ctx), '!CORE_MARKER') {
until nqp::isnull($ctx) {
my $pad := nqp::ctxlexpad($ctx);
# In 6.c and 6.d implementations of rakudo CORE was always poiting at 6.c CORE.setting
if nqp::existskey($pad, 'CORE-SETTING-REV') && nqp::iseq_s(nqp::atkey($pad, 'CORE-SETTING-REV'), 'c') {
last;
}
$ctx := nqp::ctxouterskipthunks($ctx);
}
nqp::if(
Expand All @@ -42,7 +47,7 @@ my class PseudoStash is Map {
(my $stash := nqp::create(PseudoStash)),
nqp::bindattr($stash, Map, '$!storage', nqp::ctxlexpad($ctx)),
nqp::bindattr($stash, PseudoStash, '$!ctx', $ctx),
nqp::bindattr_i($stash, PseudoStash, '$!mode', STATIC_CHAIN),
nqp::bindattr_i($stash, PseudoStash, '$!mode', PRECISE_SCOPE),
nqp::setwho(
Metamodel::ModuleHOW.new_type(:name('CORE')),
$stash)))
Expand Down

0 comments on commit 43582f5

Please sign in to comment.