Fix incorrect pcOffset computation in CloseLiveIterators (bug 746370, r=pierron).

This commit is contained in:
David Anderson 2012-05-15 15:13:39 -07:00
parent b7398ec84b
commit e325a2f35f
2 changed files with 10 additions and 2 deletions

View File

@ -335,10 +335,11 @@ CloseLiveIterators(JSContext *cx, const InlineFrameIterator &frame)
JSTryNote *tn = script->trynotes()->vector;
JSTryNote *tnEnd = tn + script->trynotes()->length;
uint32 pcOffset = uint32(pc - script->main());
for (; tn != tnEnd; ++tn) {
if (uint32(pc - script->code) < tn->start)
if (pcOffset < tn->start)
continue;
if (uint32(pc - script->code) >= tn->start + tn->length)
if (pcOffset >= tn->start + tn->length)
continue;
if (tn->kind != JSTRY_ITER)

View File

@ -0,0 +1,7 @@
var a = ['p', 'q', 'r', 's', 't'];
var o = {p:1, q:2, r:(1), s:4, t:5};
for (var i in o) {
delete o.p;
}
for each (var i in a)
assertEq(o.hasOwnProperty(i), i != 'p');