cpyext: vector calls that raise exceptions leak reference to arguments
Dear PyPy team (& @mattip),
this is the last one, I promise! (ducks)
When PyPy delivers a vector call to a CPython extension via
tp_vectorcall_offset, and when that vector call then raises an exception, there is some kind of reference counting issue. My tests indicate that the arguments are simply leaked.
This uses the
wrapper class from #3849 just out of convenience (it prints a message when an instance is created and destroyed).
$ python issue_9.py wrapper tp_init called. wrapper tp_dealloc called.
$ pypy issue_9.py wrapper tp_init called.
I also tried normal function calls via
PyMethodDef, and those work fine. I suspect it's something specifically about the implementation of vector calls.