[Python-Dev] API design question: how to extend sys.settrace()?

Guido van Rossum guido at python.org
Wed Sep 27 11:18:26 EDT 2017


On Wed, Sep 27, 2017 at 8:10 AM, Serhiy Storchaka <storchaka at gmail.com>
wrote:

> I afraid that this change breaks an assumption in frame_setlineno() about
> the state of the stack. This can corrupt the stack if you jump from the
> instruction which is a part of Python operation. For example FOR_ITER
> expects an iterator on the stack. If you jump to the end of the loop from
> the middle of an assignment operator and skip say STORE_FAST, you will left
> an arbitrary value on the stack. This can lead to unpredictable
> consequences.
>

Well, probably OT but the solution for that would be to stop using a local
stack and instead use explicit addressing.

-- 
--Guido van Rossum (python.org/~guido)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20170927/68b6a5b3/attachment.html>


More information about the Python-Dev mailing list