mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
matz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@876 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
14fe04bdac
commit
c67251edb4
23 changed files with 244 additions and 83 deletions
6
regex.c
6
regex.c
|
@ -3964,7 +3964,7 @@ re_match(bufp, string_arg, size, pos, regs)
|
|||
because didn't fail. Also remove the register information
|
||||
put on by the on_failure_jump. */
|
||||
case finalize_jump:
|
||||
if (stackp[-2] == d) {
|
||||
if (stackp > stackb && stackp[-2] == d) {
|
||||
p = stackp[-3];
|
||||
POP_FAILURE_POINT();
|
||||
continue;
|
||||
|
@ -3981,7 +3981,7 @@ re_match(bufp, string_arg, size, pos, regs)
|
|||
case jump:
|
||||
nofinalize:
|
||||
EXTRACT_NUMBER_AND_INCR(mcnt, p);
|
||||
if (mcnt < 0 && stackp > stackb && stackp[-2] == d) /* avoid infinit loop */
|
||||
if (mcnt < 0 && stackp > stackb && stackp[-2] == d) /* avoid infinite loop */
|
||||
goto fail;
|
||||
p += mcnt;
|
||||
continue;
|
||||
|
@ -4072,7 +4072,7 @@ re_match(bufp, string_arg, size, pos, regs)
|
|||
case finalize_push:
|
||||
POP_FAILURE_POINT();
|
||||
EXTRACT_NUMBER_AND_INCR(mcnt, p);
|
||||
if (mcnt < 0 && stackp[-2] == d) /* avoid infinit loop */
|
||||
if (mcnt < 0 && stackp > stackb && stackp[-2] == d) /* avoid infinite loop */
|
||||
goto fail;
|
||||
PUSH_FAILURE_POINT(p + mcnt, d);
|
||||
stackp[-1] = NON_GREEDY;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue