]> git.saurik.com Git - apple/javascriptcore.git/blob - tests/stress/int16-put-by-val-out-of-bounds-bounds-then-do-in-bounds.js
JavaScriptCore-7601.1.46.3.tar.gz
[apple/javascriptcore.git] / tests / stress / int16-put-by-val-out-of-bounds-bounds-then-do-in-bounds.js
1 function foo(a) {
2 a[42] = 95010;
3 }
4
5 noInline(foo);
6
7 function test(length, expected) {
8 var a = new Int16Array(length);
9 foo(a);
10 var result = a[42];
11 if (result != expected)
12 throw "Error: bad value at a[42]: " + result;
13 }
14
15 for (var i = 0; i < 100000; ++i)
16 test(10, void 0);
17
18 test(100, 29474);
19