Bug 604636 nsJSCID::HasInstance bails too strictly: enforces both other_wrapper are obj2 non null instead of one is
authortimeless@mozdev.org
Sun, 05 Dec 2010 12:44:30 +0000
changeset 58624 30b83f45346c6ae6f59cebaddae1a929b2bf2e99
parent 58623 8ab66adf43bb070b601c89e9dcbe5e69121399b7
child 58625 f227a6e64b3f60ce5af4583e7e1fcf3c00cafa84
push id17386
push userjwatt@jwatt.org
push dateSun, 05 Dec 2010 12:47:56 +0000
treeherdermozilla-central@f227a6e64b3f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs604636
milestone2.0b8pre
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 604636 nsJSCID::HasInstance bails too strictly: enforces both other_wrapper are obj2 non null instead of one is r=mrbkap, a=benjamin
js/src/xpconnect/src/xpcjsid.cpp
--- a/js/src/xpconnect/src/xpcjsid.cpp
+++ b/js/src/xpconnect/src/xpcjsid.cpp
@@ -889,17 +889,17 @@ nsJSCID::HasInstance(nsIXPConnectWrapped
 
         NS_ASSERTION(obj, "when is an object not an object?");
 
         // is this really a native xpcom object with a wrapper?
         JSObject* obj2;
         XPCWrappedNative* other_wrapper =
            XPCWrappedNative::GetWrappedNativeOfJSObject(cx, obj, nsnull, &obj2);
 
-        if(!other_wrapper || !obj2)
+        if(!other_wrapper && !obj2)
             return NS_OK;
 
         nsIClassInfo* ci = other_wrapper ?
                            other_wrapper->GetClassInfo() :
                            GetSlimWrapperProto(obj2)->GetClassInfo();
 
         // We consider CID equality to be the thing that matters here.
         // This is perhaps debatable.