Bug 736591 - Reduce the amount of string allocation attempted in ecma_5/RegExp/regress-617935.js to hopefully reduce intermittent orange. (The limit the test previously checked is no longer correct, so the allocation need not be repeated quite so many times as it was before this patch.) r=luke
authorJeff Walden <jwalden@mit.edu>
Mon, 16 Apr 2012 17:34:36 -0700
changeset 91809 6b33a2960e6858c253963fcd514be90085bf6d0e
parent 91808 d0988a66f47ad9bdd0939ec15cd02d6f74b550b5
child 91810 9e9d4bca6460dcdd5a668450922caf2a72012068
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewersluke
bugs736591, 617935
milestone14.0a1
Bug 736591 - Reduce the amount of string allocation attempted in ecma_5/RegExp/regress-617935.js to hopefully reduce intermittent orange. (The limit the test previously checked is no longer correct, so the allocation need not be repeated quite so many times as it was before this patch.) r=luke
js/src/tests/ecma_5/RegExp/regress-617935.js
--- a/js/src/tests/ecma_5/RegExp/regress-617935.js
+++ b/js/src/tests/ecma_5/RegExp/regress-617935.js
@@ -17,26 +17,26 @@ for (i = 0; i < 10; ++i) {
     foo += foo;
 }
 
 /* Add one "a" to cause overflow later */
 foo += "a";
 
 var bar = "bbbbbbbbbbbbbbbb";
 
-/* Make len(bar) 65536 */
-for (i = 0; i < 12; ++i) {
+/* Make len(bar) 8192 */
+for (i = 0; i < 9; ++i) {
     bar += bar;
 }
 
 /* 
  * Resulting string should be 
- * len(foo)*len(bar) = (2^10 * 32 + 1) * 65536 = 2147549184 
- * which will be negative as jsint
+ * len(foo) * len(bar) = (2**10 * 32 + 1) * 8192 = 268443648
+ * which will be larger than the max string length (2**28, or 268435456).
  */
 try {
     foo.replace(/[a]/g, bar);
 } catch (e) {
     reportCompare(e instanceof InternalError, true, "Internal error due to overallocation is ok.");
 }
 reportCompare(true, true, "No crash occurred.");
 
-print("All tests passed!");
+print("Tests complete");