Bug 998785 - Don't throw error for regexps Yarr bails on. r=jandem, a=sledru
authorTill Schneidereit <till@tillschneidereit.net>
Sun, 01 Jun 2014 18:03:38 +0200
changeset 199375 679f59ee1d57530787030b66923b1f0ef077c6f8
parent 199374 3c82cb80cda67ba703c404aaedbeb861d3225bcb
child 199376 719c6742188c47517a9712d5854eb7617b3db8a5
push id3624
push userasasaki@mozilla.com
push dateMon, 09 Jun 2014 21:49:01 +0000
treeherdermozilla-beta@b1a5da15899a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjandem, sledru
bugs998785
milestone31.0a2
Bug 998785 - Don't throw error for regexps Yarr bails on. r=jandem, a=sledru
js/src/jit-test/tests/basic/regexp-match-limit.js
js/src/yarr/YarrInterpreter.cpp
deleted file mode 100644
--- a/js/src/jit-test/tests/basic/regexp-match-limit.js
+++ /dev/null
@@ -1,9 +0,0 @@
-// See bug 953013
-
-load(libdir + "asserts.js");
-
-function test() {
-    var input = Array(2499999+1).join('a');
-    var result = /^([\w])+$/.test(input);
-}
-assertThrowsInstanceOf(test, InternalError);
--- a/js/src/yarr/YarrInterpreter.cpp
+++ b/js/src/yarr/YarrInterpreter.cpp
@@ -1456,20 +1456,17 @@ public:
             output[0] = context->matchBegin;
             output[1] = context->matchEnd;
         }
 
         freeDisjunctionContext(context);
 
         pattern->m_allocator->stopAllocator();
 
-        if (result != JSRegExpMatch && result != JSRegExpNoMatch)
-            output[0] = offsetError;
-        else
-            ASSERT((result == JSRegExpMatch) == (output[0] != offsetNoMatch));
+        ASSERT((result == JSRegExpMatch) == (output[0] != offsetNoMatch));
         return output[0];
     }
 
     Interpreter(JSContext *cx, BytecodePattern* pattern, unsigned* output, const CharType* input, unsigned length, unsigned start)
         : cx(cx)
         , pattern(pattern)
         , output(output)
         , input(input, start, length)