[Python-checkins] compiler: Merge except_table and cnotab (GH-31614)

methane webhook-mailer at python.org
Mon Feb 28 20:27:34 EST 2022


https://github.com/python/cpython/commit/df9f7597559b6256924fcd3a1c3dc24cd5c5edaf
commit: df9f7597559b6256924fcd3a1c3dc24cd5c5edaf
branch: main
author: Inada Naoki <songofacandy at gmail.com>
committer: methane <songofacandy at gmail.com>
date: 2022-03-01T10:27:20+09:00
summary:

compiler: Merge except_table and cnotab (GH-31614)

files:
M Python/compile.c

diff --git a/Python/compile.c b/Python/compile.c
index ea9c3c8d48269..3609ff8f4fb9e 100644
--- a/Python/compile.c
+++ b/Python/compile.c
@@ -8272,6 +8272,9 @@ assemble(struct compiler *c, int addNone)
     if (_PyBytes_Resize(&a.a_except_table, a.a_except_table_off) < 0) {
         goto error;
     }
+    if (!merge_const_one(c, &a.a_except_table)) {
+        goto error;
+    }
     if (!assemble_start_line_range(&a)) {
         return 0;
     }
@@ -8293,6 +8296,9 @@ assemble(struct compiler *c, int addNone)
     if (_PyBytes_Resize(&a.a_cnotab, a.a_cnotab_off) < 0) {
         goto error;
     }
+    if (!merge_const_one(c, &a.a_cnotab)) {
+        goto error;
+    }
     if (_PyBytes_Resize(&a.a_bytecode, a.a_offset * sizeof(_Py_CODEUNIT)) < 0) {
         goto error;
     }



More information about the Python-checkins mailing list