Bug 833396 - Fix some rooting issues found by static analysis r=sphink
This commit is contained in:
@@ -55,6 +55,8 @@ using namespace js::gc;
|
||||
|
||||
using mozilla::ArrayLength;
|
||||
|
||||
typedef Rooted<PropertyIteratorObject*> RootedPropertyIteratorObject;
|
||||
|
||||
static const gc::AllocKind ITERATOR_FINALIZE_KIND = gc::FINALIZE_OBJECT2;
|
||||
|
||||
void
|
||||
@@ -1074,7 +1076,7 @@ template<typename StringPredicate>
|
||||
static bool
|
||||
SuppressDeletedPropertyHelper(JSContext *cx, HandleObject obj, StringPredicate predicate)
|
||||
{
|
||||
PropertyIteratorObject *iterobj = cx->enumerators;
|
||||
RootedPropertyIteratorObject iterobj(cx, cx->enumerators);
|
||||
while (iterobj) {
|
||||
again:
|
||||
NativeIterator *ni = iterobj->getNativeIterator();
|
||||
@@ -1561,7 +1563,7 @@ SendToGenerator(JSContext *cx, JSGeneratorOp op, HandleObject obj,
|
||||
gen->regs = cx->regs();
|
||||
|
||||
cx->enterGenerator(gen); /* OOM check above. */
|
||||
PropertyIteratorObject *enumerators = cx->enumerators;
|
||||
RootedPropertyIteratorObject enumerators(cx, cx->enumerators);
|
||||
cx->enumerators = gen->enumerators;
|
||||
|
||||
RootedScript script(cx, fp->script());
|
||||
|
||||
Reference in New Issue
Block a user