Bug report
Bug description:
The following code results in two different UnboundLocalError exceptions depending on whether it's run with the JIT on or off:
deff():
if0:
classClass:
passif0:
instance=Class()
for_inrange(5000):
try:
_=instance.f()
exceptException:
passClass.__bases__= (object,)
f()
With JIT on, the UnboundLocalError points to 'instance', while with JIT off it points to 'Class'.
Traceback with JIT on:
Traceback (mostrecentcalllast):
File"/home/danzin/divergences/divergence_child_6010_3_1.py", line17, in<module>f()
~^^File"/home/danzin/divergences/divergence_child_6010_3_1.py", line12, inf_=instance.f()
^^^^^^^^UnboundLocalError: cannotaccesslocalvariable'instance'whereitisnotassociatedwithavalue
Traceback with JIT off:
Traceback (mostrecentcalllast):
File"/home/danzin/divergences/divergence_child_6010_3_1.py", line17, in<module>f()
~^^File"/home/danzin/divergences/divergence_child_6010_3_1.py", line15, infClass.__bases__= (object,)
^^^^^UnboundLocalError: cannotaccesslocalvariable'Class'whereitisnotassociatedwithavalue
Output for PYTHON_LLTRACE=4:
divergence_01_lltrace.txt
Output for PYTHON_OPT_DEBUG=4:
divergence_01_opt_debug.txt
Please let me know whether you're able to reproduce this issue.
Found using lafleur.
CPython versions tested on:
CPython main branch
Operating systems tested on:
Linux
Linked PRs
Bug report
Bug description:
The following code results in two different
UnboundLocalErrorexceptions depending on whether it's run with the JIT on or off:With JIT on, the
UnboundLocalErrorpoints to'instance', while with JIT off it points to'Class'.Traceback with JIT on:
Traceback with JIT off:
Output for
PYTHON_LLTRACE=4:divergence_01_lltrace.txt
Output for
PYTHON_OPT_DEBUG=4:divergence_01_opt_debug.txt
Please let me know whether you're able to reproduce this issue.
Found using lafleur.
CPython versions tested on:
CPython main branch
Operating systems tested on:
Linux
Linked PRs