mirror of
https://github.com/python/cpython.git
synced 2025-12-08 06:10:17 +00:00
[3.14] gh-140104: Set next_instr properly in the JIT during exceptions (GH-140233) (GH-141495)
This commit is contained in:
parent
c5e0ce73f9
commit
af20b880fc
3 changed files with 29 additions and 2 deletions
|
|
@ -1992,6 +1992,27 @@ def gen():
|
|||
next(g)
|
||||
""" % _testinternalcapi.SPECIALIZATION_THRESHOLD))
|
||||
|
||||
def test_next_instr_for_exception_handler_set(self):
|
||||
# gh-140104: We just want the exception to be caught properly.
|
||||
def f():
|
||||
for i in range(TIER2_THRESHOLD + 3):
|
||||
try:
|
||||
undefined_variable(i)
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
f()
|
||||
|
||||
def test_next_instr_for_exception_handler_set_lasts_instr(self):
|
||||
# gh-140104: We just want the exception to be caught properly.
|
||||
def f():
|
||||
a_list = []
|
||||
for _ in range(TIER2_THRESHOLD + 3):
|
||||
try:
|
||||
a_list[""] = 0
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
|
||||
def global_identity(x):
|
||||
return x
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue