]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-87092: avoid gcc warning on uninitialized struct field in assemble.c (#104460)
authorDong-hee Na <donghee.na@python.org>
Sun, 14 May 2023 11:03:30 +0000 (20:03 +0900)
committerGitHub <noreply@github.com>
Sun, 14 May 2023 11:03:30 +0000 (12:03 +0100)
Python/assemble.c

index 6889831ae3fe0ca7f3e686e718fa0cc044e5f692..8789d8ef978c22be58de375acdc2812c68265327 100644 (file)
@@ -128,7 +128,7 @@ assemble_emit_exception_table_entry(struct assembler *a, int start, int end,
     assert(end > start);
     int target = handler->h_offset;
     int depth = handler->h_startdepth - 1;
-    if (handler->h_preserve_lasti) {
+    if (handler->h_preserve_lasti > 0) {
         depth -= 1;
     }
     assert(depth >= 0);
@@ -146,6 +146,7 @@ assemble_exception_table(struct assembler *a, instr_sequence *instrs)
     int ioffset = 0;
     _PyCompile_ExceptHandlerInfo handler;
     handler.h_offset = -1;
+    handler.h_preserve_lasti = -1;
     int start = -1;
     for (int i = 0; i < instrs->s_used; i++) {
         instruction *instr = &instrs->s_instrs[i];