Bug 684922: avoid infinite recursion through GetCustomIterator, r=luke

This commit is contained in:
David Mandelin
2011-11-28 15:20:15 -08:00
parent feff4724e3
commit ecf161094b
2 changed files with 7 additions and 0 deletions

View File

@@ -354,6 +354,8 @@ size_t sCustomIteratorCount = 0;
static inline bool
GetCustomIterator(JSContext *cx, JSObject *obj, uintN flags, Value *vp)
{
JS_CHECK_RECURSION(cx, return false);
/* Check whether we have a valid __iterator__ method. */
JSAtom *atom = cx->runtime->atomState.iteratorAtom;
if (!js_GetMethod(cx, obj, ATOM_TO_JSID(atom), JSGET_NO_METHOD_BARRIER, vp))