Skip to content

Commit

Permalink
Add missing precedence info for some infix ops (#4725)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
MasterDuke17 committed Jan 18, 2022
1 parent fb909ef commit cd86606
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/core.c/precedence.pm6
Expand Up @@ -64,6 +64,10 @@ BEGIN {
trait_mod:<is>(&infix:<+&>, :prec($multiplicative));
trait_mod:<is>(&infix:<~&>, :prec($multiplicative));
trait_mod:<is>(&infix:<?&>, :prec($multiplicative));
trait_mod:<is>(&infix:«+<», :prec($multiplicative));
trait_mod:<is>(&infix:«+>», :prec($multiplicative));
trait_mod:<is>(&infix:«~<», :prec($multiplicative));
trait_mod:<is>(&infix:«~>», :prec($multiplicative));

trait_mod:<is>(&infix:<%%>, :prec($iffy));

Expand Down

0 comments on commit cd86606

Please sign in to comment.