gh-87092: avoid gcc warning on uninitialized struct field in assemble.c (#104460)

This commit is contained in:
Dong-hee Na 2023-05-14 20:03:30 +09:00 committed by GitHub
parent 080a596152
commit 178153c9a6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View 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];