Index: test/mjsunit/regexp.js |
diff --git a/test/mjsunit/regexp.js b/test/mjsunit/regexp.js |
index e562df09023f7212a61f0d1acbc76e772347fe2d..0a23d00accfb8c39bcca341026fbbf0e6a320496 100644 |
--- a/test/mjsunit/regexp.js |
+++ b/test/mjsunit/regexp.js |
@@ -375,3 +375,16 @@ assertFalse(/x([0-7]%%%x|[0-6]%%%y)/.test('x7%%%y'), 'qt8'); |
// Don't hang on this one. |
/[^\xfe-\xff]*/.test(""); |
+ |
+ |
+var long = "a"; |
+for (var i = 0; i < 100000; i++) { |
+ long = "a?" + long; |
+} |
+// Don't crash on this one, but maybe throw an exception. |
+try { |
+ RegExp(long).exec("a"); |
+} catch (e) { |
+ assertTrue(String(e).indexOf("Stack overflow") >= 0, "overflow"); |
+} |
+ |