[issue40315] Incorrect stacksize in code object

2020-04-18 Thread Skip Montanaro
Skip Montanaro added the comment: Thanks, Serhiy. -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker ___ __

[issue40315] Incorrect stacksize in code object

2020-04-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The stack size is correct. The unreachable code is left because some code (in particularly the lineno setter of the frame object) depends on instructions which may be in the unreachable code to determines the boundaries of programming blocks. It is safer t

[issue40315] Incorrect stacksize in code object

2020-04-17 Thread Skip Montanaro
New submission from Skip Montanaro : Consider this trivial function: >>> def f(): ...   while True: ...     pass ... and its disassembly: >>> dis.dis(f)   3     >>    0 JUMP_ABSOLUTE               0               2 LOAD_CONST                  0 (None)               4 RETURN_VALUE Despite its