Message390559
_PyArena_AddPyObject() only steals the object reference if successful.
- In Parser/pegen.c, _PyPegen_fill_token(), the return value is not checked at all.
- In Parser/asdl_c.py, none of the (two) calls to _PyArena_AddPyObject() decref on failure
- Ditto for Python/Python-ast.c
Attached patch fixes all callers. I'll put up a PR if it looks ok.
Alternatively, one could make _PyArena_AddPyObject() _not_ steal the reference, but since it's an exposed API, that's probably not an option. |
|
Date |
User |
Action |
Args |
2021-04-08 22:08:01 | erlendaasland | set | recipients:
+ erlendaasland, pablogsal |
2021-04-08 22:08:01 | erlendaasland | set | messageid: <1617919681.12.0.940558119091.issue43779@roundup.psfhosted.org> |
2021-04-08 22:08:01 | erlendaasland | link | issue43779 messages |
2021-04-08 22:08:01 | erlendaasland | create | |
|