Non-null prop from js_LookupProperty means found, so must unlock obj2 (now pobj) in all such cases.

This commit is contained in:
Brendan Eich 2008-07-14 00:13:31 -07:00
parent a4cb1dd828
commit 73b9a6f0c5

View File

@ -340,19 +340,23 @@ public:
if (!ATOM_IS_STRING(atom)) \
continue; \
jsid id = ATOM_TO_JSID(atom); \
JSObject* obj2; \
JSObject* pobj; \
JSProperty *prop; \
JSScopeProperty* sprop; \
if (!js_LookupProperty(cx, gvarobj, id, &obj2, (JSProperty**)&sprop)) \
if (!js_LookupProperty(cx, gvarobj, id, &pobj, &prop)) \
continue; /* XXX need to signal real error! */ \
if (obj2 != gvarobj) \
continue; \
JS_ASSERT(sprop); \
if (SPROP_HAS_STUB_GETTER(sprop) && SPROP_HAS_STUB_SETTER(sprop)) { \
if (!prop) \
continue; /* property not found -- string constant? */ \
if (pobj == gvarobj) { \
sprop = (JSScopeProperty*) prop; \
if (SPROP_HAS_STUB_GETTER(sprop) && \
SPROP_HAS_STUB_SETTER(sprop)) { \
vp = &STOBJ_GET_SLOT(gvarobj, sprop->slot); \
{ code; } \
INC_VPNUM(); \
} \
JS_UNLOCK_OBJ(cx, obj2); \
} \
JS_UNLOCK_OBJ(cx, pobj); \
} \
/* count the number of pending frames */ \
unsigned frames = 0; \