[New-bugs-announce] [issue36851] Frame stack is not cleaned after execution is finished with return

Pablo Galindo Salgado report at bugs.python.org
Wed May 8 11:40:55 EDT 2019


New submission from Pablo Galindo Salgado <pablogsal at gmail.com>:

When evaluating a frame object, it is possible to exit the execution with some variables in the stack. The frame deallocator (frame_dealloc) only cleans the stack if f_stacktop is not NULL, but this only happens for generators and when trace functions are set. The eval loop does this cleanup already if an exception is being raised, but not if a RETURN_VALUE is set.

In the PyconUS sprints, Dino and I have been working on this and we have decided that the cleanest approach is shared the same goto label with the path for exception handling, effectively cleaning up

----------
components: Interpreter Core
messages: 341891
nosy: dino.viehland, pablogsal
priority: normal
severity: normal
status: open
title: Frame stack is not cleaned after execution is finished with return
versions: Python 3.8

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue36851>
_______________________________________


More information about the New-bugs-announce mailing list