Skip to content

Commit

Permalink
Call PERL_ASYNC_CHECK when we backtrack in the regex engine
Browse files Browse the repository at this point in the history
  • Loading branch information
demerphq committed May 9, 2016
1 parent 51f69a2 commit 8df928d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
1 change: 1 addition & 0 deletions regexec.c
Original file line number Diff line number Diff line change
Expand Up @@ -8426,6 +8426,7 @@ NULL
yes_state = st->u.yes.prev_yes_state;

state_num = st->resume_state + 1; /* failure = success + 1 */
PERL_ASYNC_CHECK();
goto reenter_switch;
}
result = 0;
Expand Down
12 changes: 11 additions & 1 deletion t/re/pat.t
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ BEGIN {
skip_all_without_unicode_tables();
}

plan tests => 789; # Update this when adding/deleting tests.
plan tests => 790; # Update this when adding/deleting tests.

run_tests() unless caller;

Expand Down Expand Up @@ -1758,6 +1758,16 @@ EOP
fresh_perl_is($code, $expect, {}, "$bug - $test_name" );
}
}
{
fresh_perl_is('
BEGIN{require q(test.pl);}
watchdog(3);
$SIG{ALRM} = sub {print "Timeout\n"; exit(1)};
alarm 1;
$_ = "a" x 1000 . "b" x 1000 . "c" x 1000;
/.*a.*b.*c.*[de]/;
',"Timeout",{},"Test Perl 73464")
}
} # End of sub run_tests

1;

0 comments on commit 8df928d

Please sign in to comment.