An opcode optimize error in Python 3.12.0 #112356
Labels
3.11
only security fixes
3.12
bugs and security fixes
interpreter-core
(Objects, Python, Grammar, and Parser dirs)
type-bug
An unexpected behavior, bug, or error
Bug report
Bug description:
Here is a test in Python 3.12 test_dis.py BytecodeTests.test_disassembled, It outputs:
source code for this optimization is at: https://github.com/python/cpython/blob/3.12/Python/flowgraph.c#L1556-L1560
I feel the correct check should be:
I'm unable to write a unit test for this code to make some real error, but if opcode for LOAD_GLOBAL is changed to some odd number, test_dis will fail.
CPython versions tested on:
3.12
Operating systems tested on:
Windows
Linked PRs
The text was updated successfully, but these errors were encountered: