From e22909df3f046a1c11fa1bdc76aac7995fa0e4d9 Mon Sep 17 00:00:00 2001 From: Vadim Belman Date: Sun, 4 Aug 2019 21:08:51 -0400 Subject: [PATCH] Fix for broken EVAL at compile time Intended to fix rakudo/rakudo#3096 but wouldn't work without perl6/nqp#569. The point is that a lot of code in World.nqp expects %?OPTIONS key on %*COMPILING but CompUnit::Loader didn't set it. --- src/core/CompUnit/Loader.pm6 | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/core/CompUnit/Loader.pm6 b/src/core/CompUnit/Loader.pm6 index f2ca16bf87a..096261f7bcb 100644 --- a/src/core/CompUnit/Loader.pm6 +++ b/src/core/CompUnit/Loader.pm6 @@ -34,7 +34,8 @@ class CompUnit::Loader is repr('Uninstantiable') { multi method load-precompilation-file(IO::Path $path --> CompUnit::Handle:D) { my $handle := CompUnit::Handle.new; my $*CTXSAVE := $handle; - my %*COMPILING := nqp::hash(); + # '%?OPTIONS' is expected by some code; mainly by the World object + my %*COMPILING := nqp::hash('%?OPTIONS', nqp::hash()); nqp::loadbytecode($path.Str); $handle } @@ -42,7 +43,7 @@ class CompUnit::Loader is repr('Uninstantiable') { multi method load-precompilation-file(IO::Handle $file --> CompUnit::Handle:D) { my $handle := CompUnit::Handle.new; my $*CTXSAVE := $handle; - my %*COMPILING := nqp::hash(); + my %*COMPILING := nqp::hash('%?OPTIONS', nqp::hash()); #?if !jvm # Switch file handle to binary mode before passing it off to the VM, # so we don't lose things hanging around in the decoder. @@ -57,7 +58,7 @@ class CompUnit::Loader is repr('Uninstantiable') { method load-precompilation(Blob:D $bytes --> CompUnit::Handle:D) { my $handle := CompUnit::Handle.new; my $*CTXSAVE := $handle; - my %*COMPILING := nqp::hash(); + my %*COMPILING := nqp::hash('%?OPTIONS', nqp::hash()); nqp::loadbytecodebuffer($bytes); $handle }