From ad16c6fb8635e081f92135c5ce4e0a0f41aed63a Mon Sep 17 00:00:00 2001 From: Zoffix Znet Date: Sat, 28 Oct 2017 04:09:12 +0000 Subject: [PATCH] Fix quote lang cache regression Fixes RT#132262: https://rt.perl.org/Ticket/Display.html?id=132262 After the Big Slang Refactor, the quote lang cache started to fail to notice when the cached lang was mutated (e.g. by defining a new prefix op). This caused failure to parse new ops, such as behaviour in the ticket, since the new quoted block still used the old pre-op-mixin lang. Fix by adding the name of the lang object to key the cache on. --- src/Perl6/Grammar.nqp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Perl6/Grammar.nqp b/src/Perl6/Grammar.nqp index b58b684e3eb..7b8e4106144 100644 --- a/src/Perl6/Grammar.nqp +++ b/src/Perl6/Grammar.nqp @@ -65,7 +65,9 @@ role STD { method quote_lang($l, $start, $stop, @base_tweaks?, @extra_tweaks?) { sub lang_key() { my $stopstr := nqp::istype($stop,VMArray) ?? nqp::join(' ',$stop) !! $stop; - my @keybits := [$l.HOW.name($l), $start, $stopstr]; + my @keybits := [ + self.HOW.name(self), $l.HOW.name($l), $start, $stopstr + ]; for @base_tweaks { @keybits.push($_); }