classification
Title: Wrong destructor function type in Python/getargs.c
Type: Stage:
Components: Interpreter Core Versions: Python 3.2
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: loewis, pitrou, vstinner
Priority: normal Keywords:

Created on 2010-12-18 19:11 by pitrou, last changed 2010-12-18 19:28 by pitrou. This issue is now closed.

Messages (3)
msg124307 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2010-12-18 19:11
In getargs.c, in addcleanup_convert(), PyCapsule_SetContext() is called with a second argument "int (*destr)(PyObject*,void*)", but it really expects a "void (*PyCapsule_Destructor)(PyObject *)".
I'm not sure it's a good idea, although the ABI may be lenient enough on common architectures (?)...
msg124308 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2010-12-18 19:25
I fail to see the problem. The context is a plain void*, not (necessarily) a function pointer, and getargs uses it with the same type it put in. Why do you think PyCapsule_Destructor is of relevance?
msg124310 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2010-12-18 19:28
> I fail to see the problem. The context is a plain void*, not
> (necessarily) a function pointer, and getargs uses it with the same
> type it put in. Why do you think PyCapsule_Destructor is of relevance?

Woops, sorry. Apparently I messed up PyCapsule_SetContext and
PyCapsule_SetDestructor when reading the function declaration.
History
Date User Action Args
2010-12-18 19:28:17pitrousetstatus: open -> closed
nosy: loewis, pitrou, vstinner
resolution: not a bug
2010-12-18 19:28:05pitrousetnosy: loewis, pitrou, vstinner
messages: + msg124310
2010-12-18 19:25:18loewissetnosy: loewis, pitrou, vstinner
messages: + msg124308
2010-12-18 19:11:48pitroucreate