[pypy-commit] pypy py3.6: Issue #3066: fix just by not removing dead bytecodes
arigo
pypy.commits at gmail.com
Tue Sep 24 09:07:39 EDT 2019
Author: Armin Rigo <arigo at tunes.org>
Branch: py3.6
Changeset: r97600:68e1f1bd6ea6
Date: 2019-09-24 15:07 +0200
http://bitbucket.org/pypy/pypy/changeset/68e1f1bd6ea6/
Log: Issue #3066: fix just by not removing dead bytecodes
diff --git a/pypy/interpreter/astcompiler/assemble.py b/pypy/interpreter/astcompiler/assemble.py
--- a/pypy/interpreter/astcompiler/assemble.py
+++ b/pypy/interpreter/astcompiler/assemble.py
@@ -226,8 +226,10 @@
def is_dead_code(self):
"""Return False if any code can be meaningfully added to the
current block, or True if it would be dead code."""
- # currently only True after a RETURN_VALUE.
- return self.current_block.have_return
+ # PyPy2 only returns True after a RETURN_VALUE. Here we don't even
+ # do that, because otherwise the setter for f_lineno gets very confused.
+ # See test_f_lineno_set_4 in apptest_pyframe.py
+ return False # self.current_block.have_return
def emit_op(self, op):
"""Emit an opcode without an argument."""
diff --git a/pypy/interpreter/test/apptest_pyframe.py b/pypy/interpreter/test/apptest_pyframe.py
--- a/pypy/interpreter/test/apptest_pyframe.py
+++ b/pypy/interpreter/test/apptest_pyframe.py
@@ -169,7 +169,6 @@
assert output == [2, 9]
def test_f_lineno_set_4():
- pytest.skip("test is failing on pypy")
def jump_in_nested_finally(output):
try:
output.append(2)
More information about the pypy-commit
mailing list