]> git.saurik.com Git - apple/javascriptcore.git/blob - tests/stress/int16-put-by-val-in-and-out-of-bounds.js
JavaScriptCore-7600.1.4.9.tar.gz
[apple/javascriptcore.git] / tests / stress / int16-put-by-val-in-and-out-of-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 test(100, 29474);
18 }