Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix busted GLOBAL preservation code.
Fixes a bug whereby require would clobber GLOBAL, discovered by
sirrobert++.
  • Loading branch information
jnthn committed Sep 17, 2012
1 parent 5aa57b9 commit ec413ef
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Perl6/ModuleLoader.pm
Expand Up @@ -138,7 +138,7 @@ class Perl6::ModuleLoader {
my %trace := nqp::hash();
%trace<module> := $module_name;
%trace<filename> := %chosen<pm>;
my $preserve_global := pir::get_hll_global__Ps('GLOBAL');
my $preserve_global := pir::get_root_global__Ps('perl6'){'GLOBAL'};
nqp::push(@*MODULES, %trace);
if %chosen<load> {
%trace<precompiled> := %chosen<load>;
Expand Down Expand Up @@ -179,9 +179,9 @@ class Perl6::ModuleLoader {
DEBUG("done loading ", %chosen<pm>) if $DEBUG;

}
pir::set_hll_global__vsP('GLOBAL', $preserve_global);
pir::get_root_global__Ps('perl6'){'GLOBAL'} := $preserve_global;
CATCH {
pir::set_hll_global__vsP('GLOBAL', $preserve_global);
pir::get_root_global__Ps('perl6'){'GLOBAL'} := $preserve_global;
nqp::rethrow($_);
}
}
Expand Down

0 comments on commit ec413ef

Please sign in to comment.