De-confuse GetWrappedNativeOfJSObject about wrappers around the outer object. bug 391055, r+sr=jst

This commit is contained in:
mrbkap@gmail.com 2007-08-07 18:54:48 -07:00
parent 0197403515
commit b1458c56ab

View File

@ -1367,6 +1367,15 @@ return_tearoff:
{
JSObject *outer = ((JSExtendedClass*)clazz)->outerObject(cx, obj);
// Protect against infinite recursion through XOWs.
JSObject *unsafeObj;
clazz = JS_GET_CLASS(cx, outer);
if(clazz == &sXPC_XOW_JSClass.base &&
(unsafeObj = XPCWrapper::Unwrap(cx, outer)))
{
outer = unsafeObj;
}
if(outer && outer != obj)
return GetWrappedNativeOfJSObject(cx, outer, funobj, pobj2,
pTearOff);