From cd86606e18b29f4484ae44e5d95fdbb89a694ed3 Mon Sep 17 00:00:00 2001 From: MasterDuke17 Date: Tue, 18 Jan 2022 17:23:10 +0000 Subject: [PATCH] Add missing precedence info for some infix ops (#4725) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This fixes the segfault uncovered by 71c62e7. Because `&infix:«+<»` didn't have its precedence set, therefore the call to `.prec` went through Code's `method prec`, which simple returns `my %`. For some reason this is an HLL hash in the optimizer, so the atkey call in MoarVM has problems. It shouldn't have segfaulted and probably still needs a fix, but this change in Rakudo should happen regardless. --- src/core.c/precedence.pm6 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/core.c/precedence.pm6 b/src/core.c/precedence.pm6 index d4ba547ebb4..894e7a19afb 100644 --- a/src/core.c/precedence.pm6 +++ b/src/core.c/precedence.pm6 @@ -64,6 +64,10 @@ BEGIN { trait_mod:(&infix:<+&>, :prec($multiplicative)); trait_mod:(&infix:<~&>, :prec($multiplicative)); trait_mod:(&infix:, :prec($multiplicative)); + trait_mod:(&infix:«+<», :prec($multiplicative)); + trait_mod:(&infix:«+>», :prec($multiplicative)); + trait_mod:(&infix:«~<», :prec($multiplicative)); + trait_mod:(&infix:«~>», :prec($multiplicative)); trait_mod:(&infix:<%%>, :prec($iffy));