From d34aba3a74e37250d6cf3e36af356ef60e5bec99 Mon Sep 17 00:00:00 2001 From: sobolevn Date: Mon, 26 May 2025 10:57:51 +0300 Subject: [PATCH] gh-134693: Fix `[-Wmaybe-uninitialized]` warning in `_remote_debugging_module.c` --- Modules/_remote_debugging_module.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/Modules/_remote_debugging_module.c b/Modules/_remote_debugging_module.c index a13cbd63ad3bd8..dea7906c27246c 100644 --- a/Modules/_remote_debugging_module.c +++ b/Modules/_remote_debugging_module.c @@ -1875,6 +1875,14 @@ parse_async_frame_object( *previous_frame = GET_MEMBER(uintptr_t, frame, unwinder->debug_offsets.interpreter_frame.previous); + *code_object = GET_MEMBER(uintptr_t, frame, unwinder->debug_offsets.interpreter_frame.executable); + // Strip tag bits for consistent comparison + *code_object &= ~Py_TAG_BITS; + assert(code_object != NULL); + if ((void*)*code_object == NULL) { + return 0; + } + if (GET_MEMBER(char, frame, unwinder->debug_offsets.interpreter_frame.owner) == FRAME_OWNED_BY_CSTACK || GET_MEMBER(char, frame, unwinder->debug_offsets.interpreter_frame.owner) == FRAME_OWNED_BY_INTERPRETER) { return 0; // C frame @@ -1887,15 +1895,6 @@ parse_async_frame_object( return -1; } - *code_object = GET_MEMBER(uintptr_t, frame, unwinder->debug_offsets.interpreter_frame.executable); - // Strip tag bits for consistent comparison - *code_object &= ~Py_TAG_BITS; - - assert(code_object != NULL); - if ((void*)*code_object == NULL) { - return 0; - } - uintptr_t instruction_pointer = GET_MEMBER(uintptr_t, frame, unwinder->debug_offsets.interpreter_frame.instr_ptr); // Get tlbc_index for free threading builds