Skip to content

Commit 178153c

Browse files
authored
gh-87092: avoid gcc warning on uninitialized struct field in assemble.c (#104460)
1 parent 080a596 commit 178153c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Python/assemble.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ assemble_emit_exception_table_entry(struct assembler *a, int start, int end,
128128
assert(end > start);
129129
int target = handler->h_offset;
130130
int depth = handler->h_startdepth - 1;
131-
if (handler->h_preserve_lasti) {
131+
if (handler->h_preserve_lasti > 0) {
132132
depth -= 1;
133133
}
134134
assert(depth >= 0);
@@ -146,6 +146,7 @@ assemble_exception_table(struct assembler *a, instr_sequence *instrs)
146146
int ioffset = 0;
147147
_PyCompile_ExceptHandlerInfo handler;
148148
handler.h_offset = -1;
149+
handler.h_preserve_lasti = -1;
149150
int start = -1;
150151
for (int i = 0; i < instrs->s_used; i++) {
151152
instruction *instr = &instrs->s_instrs[i];

0 commit comments

Comments
 (0)