bpo-27286 fixed a problem where BUILD_MAP_UNPACK_WITH_CALL could be emitted with an incorrect oparg value, causing the eval loop to access the wrong stack entry when attempting to read the function name. The associated magic number change caused significant problems when attempting to upgrade to 3.5.3 for anyone that relies on pre-cached bytecode remaining valid across maintenance releases. This patch restores the ability to import legacy bytecode generated by 3.5.0, 3.5.1 or 3.5.2 (TODO!), and modifies the eval loop to avoid any harmful consequences from the potentially malformed legacy bytecode.
ncoghlan
changed the title
WIP: [3.5] bpo-29537: Tolerate legacy invalid bytecode
[3.5] bpo-29537: Tolerate legacy invalid bytecode
ncoghlan deleted the bpo29537-handle-legacy-BUILD_MAP_UNPACK_WITH_CALL-bytecode branch
akruis pushed a commit to akruis/cpython that referenced this pull request
… modules (python#169) Many extension modules were created by Cython versions before commit 037bcf0 and were compiled with regular C-Python. These modules call PyEval_EvalFrameEx() with a broken frame object. This commit add code to recover a broken frame in PyEval_EvalFrameEx().
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters