X-Git-Url: https://git.saurik.com/apple/javascriptcore.git/blobdiff_plain/2d39b0e377c0896910ee49ae70082ba665faf986..ed1e77d3adeb83d26fd1dfb16dd84cabdcefd250:/tests/stress/goofy-function-reentry-incorrect-inference.js diff --git a/tests/stress/goofy-function-reentry-incorrect-inference.js b/tests/stress/goofy-function-reentry-incorrect-inference.js new file mode 100644 index 0000000..a371347 --- /dev/null +++ b/tests/stress/goofy-function-reentry-incorrect-inference.js @@ -0,0 +1,25 @@ +function foo(a) { + var x; + if (a) + x = a; + return [function() { + return x; + }, function(a) { + x = a; + }]; +} + +var array = foo(false); +noInline(array[0]); +noInline(array[1]); +array[1](42); +for (var i = 0; i < 10000; ++i) { + var result = array[0](); + if (result != 42) + throw "Error: bad result in loop: " + result; +} + +array[1](43); +var result = array[0](); +if (result != 43) + throw "Error: bad result at end: " + result;