Bug 613399: set isMatch on empty-match backtrack return in PCRE, r=cdleary
authorDavid Mandelin <dmandelin@mozilla.com>
Wed, 12 Jan 2011 18:56:52 -0800
changeset 60582 c8cb1ab7612aeef4da89d843601073e941dfa6ec
parent 60581 f2da7d8646f63b6871b581431e876d51fa8605f7
child 60583 57896fa8bb787db9d341c8939f65e1403f5da75d
push id18037
push usercleary@mozilla.com
push dateFri, 14 Jan 2011 17:42:55 +0000
treeherdermozilla-central@4e0501a0c5e5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerscdleary
bugs613399
milestone2.0b10pre
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 613399: set isMatch on empty-match backtrack return in PCRE, r=cdleary
js/src/jit-test/tests/basic/bug613399.js
js/src/yarr/pcre/pcre_exec.cpp
new file mode 100644
--- /dev/null
+++ b/js/src/jit-test/tests/basic/bug613399.js
@@ -0,0 +1,3 @@
+// don't assert
+/((?=()+))?/.exec("");
+
--- a/js/src/yarr/pcre/pcre_exec.cpp
+++ b/js/src/yarr/pcre/pcre_exec.cpp
@@ -699,17 +699,17 @@ RECURSE:
                 if (stack.currentFrame->locals.number > 0) {
                     if (stack.currentFrame->locals.offset >= md.offsetMax)
                         md.offsetOverflow = true;
                     else {
                         int start = md.offsetVector[md.offsetEnd - stack.currentFrame->locals.number];
                         int end = stack.currentFrame->args.subjectPtr - md.startSubject;
                         if (start == end && stack.currentFrame->args.groupMatched) {
                             DPRINTF(("empty string while group already matched; bailing"));
-                            RRETURN;
+                            RRETURN_NO_MATCH;
                         }
                         DPRINTF(("saving; start: %d; end: %d\n", start, end));
                         JS_ASSERT(start <= end);
                         md.setOffsetPair(stack.currentFrame->locals.number, start, end);
                         if (stack.currentFrame->args.offsetTop <= stack.currentFrame->locals.offset)
                             stack.currentFrame->args.offsetTop = stack.currentFrame->locals.offset + 2;
                     }
                 }