зеркало из https://github.com/mozilla/gecko-dev.git
Fix up bogus casts of nsXPTType pointers - fixes segment faults on some
platforms. Not part of the build.
This commit is contained in:
Родитель
17c00a5a98
Коммит
8ccfeb6a17
|
@ -309,12 +309,12 @@ static PyObject *PyGetTypeForParam(PyObject *self, PyObject *args)
|
|||
const nsXPTMethodInfo *pmi;
|
||||
if (!__GetMethodInfoHelper(pii, mi, pi, &pmi))
|
||||
return NULL;
|
||||
nsXPTType datumType;
|
||||
nsXPTType datumType;
|
||||
const nsXPTParamInfo& param_info = pmi->GetParam((PRUint8)pi);
|
||||
nsresult n = pii->GetTypeForParam(mi, ¶m_info, dim, &datumType);
|
||||
if (NS_FAILED(n))
|
||||
return PyXPCOM_BuildPyException(n);
|
||||
return PyObject_FromXPTTypeDescriptor((const XPTTypeDescriptor *)&datumType);
|
||||
return PyObject_FromXPTType(&datumType);
|
||||
}
|
||||
|
||||
static PyObject *PyGetSizeIsArgNumberForParam(PyObject *self, PyObject *args)
|
||||
|
|
|
@ -29,6 +29,18 @@
|
|||
// (c) 2000, ActiveState corp.
|
||||
#include "PyXPCOM_std.h"
|
||||
|
||||
PyObject *PyObject_FromXPTType( const nsXPTType *d)
|
||||
{
|
||||
if (d==nsnull) {
|
||||
Py_INCREF(Py_None);
|
||||
return Py_None;
|
||||
}
|
||||
// build an object using the same format as a TypeDescriptor.
|
||||
return Py_BuildValue("bzzz",
|
||||
d->flags,
|
||||
NULL, NULL, NULL);
|
||||
}
|
||||
|
||||
PyObject *PyObject_FromXPTTypeDescriptor( const XPTTypeDescriptor *d)
|
||||
{
|
||||
if (d==nsnull) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче