Hi,
I am using stackless python 3.4.2. I'd like to know if anyone that has used
PyTasklet_New function encountered the same problem when passing in NULL as the
first argument. According to the documentation,
"PyTaskletObject *PyTasklet_New(PyTypeObject *type, PyObject *func)
Return a new tasklet object. type must be derived from PyTasklet_Type or NULL.
func must be a callable object (normal use-case) or NULL, if the tasklet is
being used via capture()."
But it crashes when I pass in NULL as first argument. I looked at the source
code, and it is:
PyTasklet_New(PyTypeObject *type, PyObject *func)
{
if (!PyType_IsSubtype(type, &PyTasklet_Type)) {
PyErr_SetNone(PyExc_TypeError);
return NULL;
}
......
}
int
PyType_IsSubtype(PyTypeObject *a, PyTypeObject *b)
{
PyObject *mro;
mro = a->tp_mro;
....
}
So the pointer is dereferenced without being checked thus causing the crash?
Jun
_______________________________________________
Stackless mailing list
[email protected]
http://www.stackless.com/mailman/listinfo/stackless