X-Git-Url: https://git.saurik.com/apple/javascriptcore.git/blobdiff_plain/4be4e30906bcb8ee30b4d189205cb70bad6707ce..81345200c95645a1b0d2635520f96ad55dfde63f:/tests/stress/float32-array-out-of-bounds.js diff --git a/tests/stress/float32-array-out-of-bounds.js b/tests/stress/float32-array-out-of-bounds.js new file mode 100644 index 0000000..b50765d --- /dev/null +++ b/tests/stress/float32-array-out-of-bounds.js @@ -0,0 +1,23 @@ +function foo(a) { + return a[42]; +} + +noInline(foo); + +var shortArray = new Float32Array(10); +var longArray = new Float32Array(100); + +function test(array, expected) { + var result = foo(array); + if (result != expected) + throw new Error("bad result: " + result); +} + +for (var i = 0; i < 1000; ++i) + test(shortArray, void 0); + +for (var i = 0; i < 100000; ++i) + test(longArray, 0); + +test(shortArray, void 0); +