summaryrefslogtreecommitdiffstats
path: root/regex.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-08-07 05:05:04 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-08-07 05:05:04 +0000
commit031e40b61d2cdb4c8aac9456e08cec9bb8729fdc (patch)
tree81d59bfb40b0efc64b3acfc9cbe4dd7d3628af85 /regex.c
parent348746f66f9df54f66f83478093a6189f5d140df (diff)
downloadruby-031e40b61d2cdb4c8aac9456e08cec9bb8729fdc.tar.gz
ruby-031e40b61d2cdb4c8aac9456e08cec9bb8729fdc.tar.xz
ruby-031e40b61d2cdb4c8aac9456e08cec9bb8729fdc.zip
matz
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@876 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'regex.c')
-rw-r--r--regex.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/regex.c b/regex.c
index 156e75bb4..189c28205 100644
--- a/regex.c
+++ b/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;