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