diff options
author | Irit Katriel <1055913+iritkatriel@users.noreply.github.com> | 2024-02-22 12:36:44 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-22 12:36:44 (GMT) |
commit | 96c1737591b45bc1c528df1103eb0e500751fefe (patch) | |
tree | 8adb232e4843cfcae2a32d8cc48de73fb160a3d7 /Python | |
parent | 8aa372edcd857d2fbec8da0cb993de15b4179308 (diff) | |
download | cpython-96c1737591b45bc1c528df1103eb0e500751fefe.zip cpython-96c1737591b45bc1c528df1103eb0e500751fefe.tar.gz cpython-96c1737591b45bc1c528df1103eb0e500751fefe.tar.bz2 |
gh-115796: fix exception table construction in _testinternalcapi.assemble_code_object (#115797)
Diffstat (limited to 'Python')
-rw-r--r-- | Python/flowgraph.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/Python/flowgraph.c b/Python/flowgraph.c index 4d9ba9e..2f47e47 100644 --- a/Python/flowgraph.c +++ b/Python/flowgraph.c @@ -665,12 +665,6 @@ translate_jump_labels_to_targets(basicblock *entryblock) return SUCCESS; } -int -_PyCfg_JumpLabelsToTargets(cfg_builder *g) -{ - return translate_jump_labels_to_targets(g->g_entryblock); -} - static int mark_except_handlers(basicblock *entryblock) { #ifndef NDEBUG @@ -2790,3 +2784,14 @@ _PyCfg_OptimizedCfgToInstructionSequence(cfg_builder *g, return SUCCESS; } + +/* This is used by _PyCompile_Assemble to fill in the jump and exception + * targets in a synthetic CFG (which is not the ouptut of the builtin compiler). + */ +int +_PyCfg_JumpLabelsToTargets(cfg_builder *g) +{ + RETURN_IF_ERROR(translate_jump_labels_to_targets(g->g_entryblock)); + RETURN_IF_ERROR(label_exception_targets(g->g_entryblock)); + return SUCCESS; +} |