mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Fix crash on nested Iterator iteration, bug 590813. r=gal
This commit is contained in:
parent
62a29ff1c1
commit
d4b43f3df0
@ -123,16 +123,11 @@ NativeIterator::mark(JSTracer *trc)
|
||||
MarkObject(trc, obj, "obj");
|
||||
}
|
||||
|
||||
/*
|
||||
* Shared code to close iterator's state either through an explicit call or
|
||||
* when GC detects that the iterator is no longer reachable.
|
||||
*/
|
||||
static void
|
||||
iterator_finalize(JSContext *cx, JSObject *obj)
|
||||
{
|
||||
JS_ASSERT(obj->getClass() == &js_IteratorClass);
|
||||
|
||||
/* Avoid double work if the iterator was closed by JSOP_ENDITER. */
|
||||
NativeIterator *ni = obj->getNativeIterator();
|
||||
if (ni) {
|
||||
cx->free(ni);
|
||||
@ -811,8 +806,6 @@ js_CloseIterator(JSContext *cx, JSObject *obj)
|
||||
ni->props_cursor = ni->props_array;
|
||||
ni->next = *hp;
|
||||
*hp = obj;
|
||||
} else {
|
||||
iterator_finalize(cx, obj);
|
||||
}
|
||||
}
|
||||
#if JS_HAS_GENERATORS
|
||||
|
Loading…
Reference in New Issue
Block a user