diff options
author | Damien George <damien.p.george@gmail.com> | 2018-02-27 15:39:31 +1100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2018-02-27 15:39:31 +1100 |
commit | 22ade2f5c4ac88c90a013cbf4b81c8d795487f33 (patch) | |
tree | c764b91e008542db57a923ec502529201f72b188 /tests/float/float_format.py | |
parent | c5fe610ba15468e1d92d7b6d5f5962f7595e3324 (diff) |
py/vm: Fix case of handling raised StopIteration within yield from.
This patch concerns the handling of an NLR-raised StopIteration, raised
during a call to mp_resume() which is handling the yield from opcode.
Previously, commit 6738c1dded8e436686f85008ec0a4fc47406ab7a introduced code
to handle this case, along with a test. It seems that it was lucky that
the test worked because the code did not correctly handle the stack pointer
(sp).
Furthermore, commit 79d996a57b351e0ef354eb1e2f644b194433cc73 improved the
way mp_resume() propagated certain exceptions: it changed raising an NLR
value to returning MP_VM_RETURN_EXCEPTION. This change meant that the
test introduced in gen_yield_from_ducktype.py was no longer hitting the
code introduced in 6738c1dded8e436686f85008ec0a4fc47406ab7a.
The patch here does two things:
1. Fixes the handling of sp in the VM for the case that yield from is
interrupted by a StopIteration raised via NLR.
2. Introduces a new test to check this handling of sp and re-covers the
code in the VM.
Diffstat (limited to 'tests/float/float_format.py')
0 files changed, 0 insertions, 0 deletions