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:
Bobby Holley 2011-09-23 14:50:28 -07:00
Родитель cb8d312cbb
Коммит 6c21fbc598
2 изменённых файлов: 6 добавлений и 5 удалений

Просмотреть файл

@ -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:
&param_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:
&param_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();