blob: d11b9dd90bcd5312f53fc58a32046aa1d57cebca [file] [log] [blame]
function bar()
{
}
noInline(bar);
function foo(p, x)
{
var a = /Hello/;
a.lastIndex = 1;
var b = /World/;
b.lastIndex = a;
var c = /World/;
c.lastIndex = a;
if (!p)
return 0;
bar(b);
x += 2000000000;
c.lastIndex.lastIndex = 42;
return b.lastIndex.lastIndex;
}
noInline(foo);
function test(x)
{
var result = foo(true, x);
if (result != 42)
throw "Error: bad result: " + result;
}
for (var i = 0; i < 100000; ++i)
test(0);
test(2000000000);