STINNER Victor added the comment:

Updated patch. I added a NEWS entry and the two assertions from  lasti.patch. 
These assertions are basic sanity checks, not directly related to this issue, 
they shouldn't harm. A started frame must never go back to the not-started 
state (f_lasti < 0).

Yury: "How about we commit pygen_yf.patch to 3.6 and whatever else in 3.7?"

Wordcode is already a massive change in our bytecode, I would prefer to not 
touch f_lasti just as a late update of WORDCODE in 3.7.

I'm ok to keep f_lasti == -1 for frames not started yet.


Serhiy: "I prefer pygen_yf.patch (with addressing Yury's suggestions)."

Ok, fine. I'm also more confident in smaller changes when we are very close to 
the final release! So let's forget lasti.patch ;-) (Sorry Demur!)

--

FYI attached test.py reproduces the bug because Cursor._read_data() starts with 
the instruction  "SETUP_LOOP 72" and 72 is the code of the operation YIELD_FROM 
:-)

To reproduce the bug, you must have a code object where the second byte is 72. 
It's not easy to control the generated bytecode from the Python code, so I 
decided to not write an unit test for this bug.

----------
Added file: http://bugs.python.org/file45625/pygen_yf-2.patch

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue28782>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to