зеркало из https://github.com/mozilla/gecko-dev.git
Bug 683802 - Eliminate questionable support for [shared] parameters. r=mrbkap
AFAICT we'd crash if we hit these cases anyway. bsmedberg and khuey requested that I assert against this case within XPConnect, and file a bug to make XPIDL enforce that [shared] parameters exist only in [noscript] methods. Filed bug 685281 for this.
This commit is contained in:
Родитель
cb8d312cbb
Коммит
6c21fbc598
|
@ -1708,6 +1708,7 @@ pre_call_clean_up:
|
|||
for(i = 0; i < paramCount; i++)
|
||||
{
|
||||
const nsXPTParamInfo& param = info->params[i];
|
||||
NS_ABORT_IF_FALSE(!param.IsShared(), "[shared] implies [noscript]!");
|
||||
if(!param.IsOut() && !param.IsDipper())
|
||||
continue;
|
||||
|
||||
|
@ -1745,7 +1746,7 @@ pre_call_clean_up:
|
|||
¶m_iid)))
|
||||
break;
|
||||
}
|
||||
else if(type.IsPointer() && !param.IsShared() && !param.IsDipper())
|
||||
else if(type.IsPointer() && !param.IsDipper())
|
||||
useAllocator = JS_TRUE;
|
||||
|
||||
if(!XPCConvert::JSData2Native(ccx, &pv->val, val, type,
|
||||
|
@ -1804,7 +1805,7 @@ pre_call_clean_up:
|
|||
¶m_iid))
|
||||
break;
|
||||
}
|
||||
else if(type.IsPointer() && !param.IsShared())
|
||||
else if(type.IsPointer())
|
||||
useAllocator = JS_TRUE;
|
||||
|
||||
if(isArray || isSizedString)
|
||||
|
|
|
@ -2807,6 +2807,7 @@ CallMethodHelper::ConvertIndependentParam(uint8 i)
|
|||
uint8 type_tag = type.TagPart();
|
||||
nsXPTCVariant* dp = GetDispatchParam(i);
|
||||
dp->type = type;
|
||||
NS_ABORT_IF_FALSE(!paramInfo.IsShared(), "[shared] implies [noscript]!");
|
||||
|
||||
// Handle dipper types separately.
|
||||
if(paramInfo.IsDipper())
|
||||
|
@ -2840,8 +2841,7 @@ CallMethodHelper::ConvertIndependentParam(uint8 i)
|
|||
if(paramInfo.IsOut())
|
||||
{
|
||||
if(type.IsPointer() &&
|
||||
type_tag != nsXPTType::T_INTERFACE &&
|
||||
!paramInfo.IsShared())
|
||||
type_tag != nsXPTType::T_INTERFACE)
|
||||
{
|
||||
useAllocator = JS_TRUE;
|
||||
dp->SetValNeedsCleanup();
|
||||
|
@ -2974,7 +2974,7 @@ CallMethodHelper::ConvertDependentParams()
|
|||
{
|
||||
if(datum_type.IsPointer() &&
|
||||
!datum_type.IsInterfacePointer() &&
|
||||
(isArray || !paramInfo.IsShared()))
|
||||
isArray)
|
||||
{
|
||||
useAllocator = JS_TRUE;
|
||||
dp->SetValNeedsCleanup();
|
||||
|
|
Загрузка…
Ссылка в новой задаче