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
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
--- 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");