summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/bug1782562-toSource-veclen.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/jit-test/tests/bug1782562-toSource-veclen.js')
-rw-r--r--js/src/jit-test/tests/bug1782562-toSource-veclen.js32
1 files changed, 32 insertions, 0 deletions
diff --git a/js/src/jit-test/tests/bug1782562-toSource-veclen.js b/js/src/jit-test/tests/bug1782562-toSource-veclen.js
new file mode 100644
index 0000000000..21b885193b
--- /dev/null
+++ b/js/src/jit-test/tests/bug1782562-toSource-veclen.js
@@ -0,0 +1,32 @@
+// |jit-test| skip-if: getBuildConfiguration()["android"]
+
+try {
+ var z = "1";
+ try {
+ f = function (x) {
+ (function(){});
+ (function(){});
+ (function(){});
+ (function(){});
+ (function(){});
+ (function(){});
+ (function(){});
+ (function(){});
+ (function(){});
+ (function(){});
+ (function(){});
+ (function(){});
+ (function(){});
+ (function(){});
+ (function(){});
+ (function(){});
+ };
+ for (let i = 0; i < 99; i++)
+ z += z
+ } catch (e) {}
+ uneval(this);
+ assertEq(getBuildConfiguration()["pointer-byte-size"], 8, "32-bit should OOM; 64-bit should not");
+} catch (e) {
+ const msg = e + "";
+ assertEq(msg.includes("out of memory") || msg.includes("InternalError: allocation size overflow"), true);
+}