mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-27 21:00:50 +00:00
Fixing bug 113856. Don't crash when resolving a name of a class w/o a primary iid. r=heikki@netscape.com, sr=vidur@netscape.com
This commit is contained in:
parent
97c85e367d
commit
09364bd390
@ -3162,19 +3162,21 @@ nsWindowSH::GlobalResolve(nsISupports *native, JSContext *cx, JSObject *obj,
|
||||
return NS_ERROR_UNEXPECTED;
|
||||
}
|
||||
|
||||
const nsDOMClassInfoData *ci_data = nsnull;
|
||||
|
||||
if (name_struct->mType == nsGlobalNameStruct::eTypeClassConstructor &&
|
||||
name_struct->mDOMClassInfoID >= 0) {
|
||||
ci_data = &sClassInfoData[name_struct->mDOMClassInfoID];
|
||||
}
|
||||
|
||||
const nsIID *primary_iid = &NS_GET_IID(nsISupports);
|
||||
|
||||
if (name_struct->mType == nsGlobalNameStruct::eTypeClassProto) {
|
||||
primary_iid = &name_struct->mIID;
|
||||
} else if (name_struct->mDOMClassInfoID >= 0) {
|
||||
primary_iid =
|
||||
sClassInfoData[name_struct->mDOMClassInfoID].mProtoChainInterface;
|
||||
} else if (ci_data && ci_data->mProtoChainInterface) {
|
||||
primary_iid = ci_data->mProtoChainInterface;
|
||||
}
|
||||
|
||||
NS_ABORT_IF_FALSE(!primary_iid->Equals(NS_GET_IID(nsISupports)),
|
||||
"Class with nsISupports as primary IID seen in the "
|
||||
"resolver");
|
||||
|
||||
nsXPIDLCString class_parent_name;
|
||||
|
||||
if (!primary_iid->Equals(NS_GET_IID(nsISupports))) {
|
||||
@ -3197,13 +3199,6 @@ nsWindowSH::GlobalResolve(nsISupports *native, JSContext *cx, JSObject *obj,
|
||||
iim->GetInfoForIID(primary_iid, getter_AddRefs(if_info));
|
||||
NS_ENSURE_TRUE(if_info, NS_ERROR_UNEXPECTED);
|
||||
|
||||
const nsDOMClassInfoData *ci_data = nsnull;
|
||||
|
||||
if (name_struct->mType == nsGlobalNameStruct::eTypeClassConstructor &&
|
||||
name_struct->mDOMClassInfoID >= 0) {
|
||||
ci_data = &sClassInfoData[name_struct->mDOMClassInfoID];
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIInterfaceInfo> parent;
|
||||
nsIID *iid = nsnull;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user