Revert previous change to YARR (bug 824856, r=sstangl, a=lsblakk).
authorDavid Anderson <danderson@mozilla.com>
Thu, 21 Feb 2013 14:52:20 -0800
changeset 132341 173181c18cf0410f06e806add6f297dc3f60d956
parent 132340 352b0d752f5d0ff35e90c85dc31cd323bd4e0ddd
child 132342 6ba714700f7c791029776a3faabcd03458852c00
push id2323
push userbbajaj@mozilla.com
push dateMon, 01 Apr 2013 19:47:02 +0000
treeherdermozilla-beta@7712be144d91 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssstangl, lsblakk
bugs824856
milestone21.0a2
Revert previous change to YARR (bug 824856, r=sstangl, a=lsblakk).
js/src/jit-test/tests/basic/bug824856.js
js/src/yarr/YarrInterpreter.cpp
new file mode 100644
--- /dev/null
+++ b/js/src/jit-test/tests/basic/bug824856.js
@@ -0,0 +1,6 @@
+// |jit-test| error: TypeError
+RegExp("(&)??\\1}").test("&D")
+"xy".match(/((x)??){2}y/)
+"\u66d6J".split(/((\u66d6)??){7}J/)
+"2\"".match("(((2)??)+\")")()
+
--- a/js/src/yarr/YarrInterpreter.cpp
+++ b/js/src/yarr/YarrInterpreter.cpp
@@ -741,17 +741,17 @@ public:
                     // the same anyway! (We don't pre-check for greedy or non-greedy matches.)
                     ASSERT((&term - term.atom.parenthesesWidth)->type == ByteTerm::TypeParenthesesSubpatternOnceBegin);
 
 		    // Disabled, see bug 808478
 #if 0
                     ASSERT((&term - term.atom.parenthesesWidth)->inputPosition == term.inputPosition);
 #endif
                     unsigned subpatternId = term.atom.subpatternId;
-                    output[subpatternId << 1] = input.getPos() + (&term - term.atom.parenthesesWidth)->inputPosition;
+                    output[subpatternId << 1] = input.getPos() + term.inputPosition;
                 }
                 context->term -= term.atom.parenthesesWidth;
                 return true;
             }
         case QuantifierFixedCount:
             break;
         }