Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
remove apparently dangerous literal optimization
  • Loading branch information
timo committed Nov 20, 2013
1 parent e4e9ac8 commit 342e93b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/NQP/Optimizer.nqp
Expand Up @@ -55,9 +55,11 @@ class NQP::RegexOptimizer {
$qast[0][1][2][1] := $simple;
}
my $result := 0;
if $simple.rxtype eq 'literal' && $simple.rxtype ne 'ignorecase' {
# FIXME something is causing trouble with literals here. segfault on parrot,
# NQP tests failing, ...
if 0 && $simple.rxtype eq 'literal' && $simple.rxtype ne 'ignorecase' && !$qast.negate {
$result := QAST::Regex.new(:rxtype<literal>, :subtype<zerowidth>, :node($simple.node),
:negate(nqp::bitxor_i($qast.negate, $simple.negate)),
:negate($qast.negate),
$simple[0]);
} elsif $simple.rxtype eq 'enumcharlist' && $simple.rxtype ne 'ignorecase' {
$result := QAST::Regex.new(:rxtype<enumcharlist>, :subtype<zerowidth>, :node($simple.node),
Expand Down

0 comments on commit 342e93b

Please sign in to comment.