GH-108976. Keep monitoring data structures valid during de-optimization during callback. (GH-109131)

This commit is contained in:
Mark Shannon 2023-09-11 14:37:09 +01:00 committed by GitHub
parent 60b8341d07
commit 4a69301ea4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 79 additions and 55 deletions

View file

@ -1719,6 +1719,14 @@ class TestRegressions(MonitoringTestBase, unittest.TestCase):
finally:
sys.monitoring.set_events(TEST_TOOL, 0)
def test_gh108976(self):
sys.monitoring.use_tool_id(0, "test")
sys.monitoring.set_events(0, 0)
sys.monitoring.register_callback(0, E.LINE, lambda *args: sys.monitoring.set_events(0, 0))
sys.monitoring.register_callback(0, E.INSTRUCTION, lambda *args: 0)
sys.monitoring.set_events(0, E.LINE | E.INSTRUCTION)
sys.monitoring.set_events(0, 0)
class TestOptimizer(MonitoringTestBase, unittest.TestCase):