Skip to content

Commit cf79448

Browse files
committed
Revert "literal with ignorecase now caches lc results"
it broke some perl5 regex spec tests. This reverts commit cedea6d. # Conflicts: # src/vm/moar/QAST/QASTRegexCompilerMAST.nqp
1 parent 94ff637 commit cf79448

File tree

1 file changed

+2
-16
lines changed

1 file changed

+2
-16
lines changed

src/vm/moar/QAST/QASTRegexCompilerMAST.nqp

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -661,23 +661,9 @@ class QAST::MASTRegexCompiler {
661661
op($op, $s0, %!reg<zero>, sval(nqp::lc($c) ~ nqp::uc($c)), %!reg<fail>),
662662
]);
663663
}
664-
elsif $node.subtype eq 'ignorecase' {
665-
# XXX ignorecase may want fc instead of lc
666-
my $cmpop := $node.negate ?? 'if_i' !! 'unless_i';
667-
nqp::push(@ins, op('const_s', $s0, sval(nqp::lc($litconst))));
668-
unless nqp::existskey(%!reg, 'haystacklc') {
669-
%!reg<haystacklc> := $!regalloc.fresh_s();
670-
}
671-
my $no_need_lc := label();
672-
nqp::push(@ins, op('isnull_s', $i0, %!reg<haystacklc>));
673-
nqp::push(@ins, op('unless_i', $i0, $no_need_lc));
674-
nqp::push(@ins, op('lc', %!reg<haystacklc>, %!reg<tgt>));
675-
nqp::push(@ins, $no_need_lc);
676-
nqp::push(@ins, op('eqat_s', $i0, %!reg<haystacklc>, $s0, %!reg<pos>));
677-
nqp::push(@ins, op($cmpop, $i0, %!reg<fail>));
678-
}
679664
else {
680-
my $eq_op := $node.subtype eq 'ignoremark' ?? 'eqatim_s' !! 'eqat_s';
665+
my $eq_op := $node.subtype eq 'ignorecase' ?? 'eqatic_s' !!
666+
$node.subtype eq 'ignoremark' ?? 'eqatim_s' !! 'eqat_s';
681667
my $cmpop := $node.negate ?? 'if_i' !! 'unless_i';
682668
nqp::push(@ins, op('const_s', $s0, sval($litconst)));
683669
nqp::push(@ins, op($eq_op, $i0, %!reg<tgt>, $s0, %!reg<pos>));

0 commit comments

Comments
 (0)