]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-149953: Fix null pointer dereference order in `code_objects.c` (#149956)
authorNezuko Agent <nezukoagent@gmail.com>
Mon, 18 May 2026 08:28:28 +0000 (15:28 +0700)
committerGitHub <noreply@github.com>
Mon, 18 May 2026 08:28:28 +0000 (11:28 +0300)
Move  check before

Modules/_remote_debugging/code_objects.c

index 7b95c0f2d4fa8da6384b86026110502aff0f21c9..97c6ba772e88f1d5f4feafa671f6624dd0cdd9fc 100644 (file)
@@ -432,7 +432,7 @@ parse_code_object(RemoteUnwinderObject *unwinder,
 
 #ifdef Py_GIL_DISABLED
     // Handle thread-local bytecode (TLBC) in free threading builds
-    if (ctx->tlbc_index == 0 || unwinder->debug_offsets.code_object.co_tlbc == 0 || unwinder == NULL) {
+    if (ctx->tlbc_index == 0 || unwinder == NULL || unwinder->debug_offsets.code_object.co_tlbc == 0) {
         // No TLBC or no unwinder - use main bytecode directly
         addrq = (uint16_t *)ip - (uint16_t *)meta->addr_code_adaptive;
         goto done_tlbc;