]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
compiler: Merge except_table and cnotab (GH-31614)
authorInada Naoki <songofacandy@gmail.com>
Tue, 1 Mar 2022 01:27:20 +0000 (10:27 +0900)
committerGitHub <noreply@github.com>
Tue, 1 Mar 2022 01:27:20 +0000 (10:27 +0900)
Python/compile.c

index ea9c3c8d48269e3cb7229a9435151151abbd0d2c..3609ff8f4fb9e5dec66eb933f64ab749b49c7c36 100644 (file)
@@ -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;
     }