[3.15] gh-149953: Fix null pointer dereference order in code_objects.c (GH-149956) (#149976)

gh-149953: Fix null pointer dereference order in `code_objects.c` (GH-149956)

Move  check before
(cherry picked from commit 0ed497a350)

Co-authored-by: Nezuko Agent <nezukoagent@gmail.com>
This commit is contained in:
Miss Islington (bot) 2026-05-18 11:00:19 +02:00 committed by GitHub
parent 42ff9b4959
commit 6e83c55e64
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

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