]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Update optimizer.c
authorKen Jin <28750310+Fidget-Spinner@users.noreply.github.com>
Fri, 7 Nov 2025 22:59:14 +0000 (22:59 +0000)
committerKen Jin <28750310+Fidget-Spinner@users.noreply.github.com>
Fri, 7 Nov 2025 22:59:14 +0000 (22:59 +0000)
Python/optimizer.c

index c38f28e224a8b6da9ca34397cafeb481e63f1378..f1d0ca811c7e00bcff0bb3e1e89ec1cfe08629f7 100644 (file)
@@ -711,7 +711,10 @@ _PyJit_translate_single_bytecode_to_trace(
         max_length--;
     }
 
-    RESERVE_RAW(expansion->nuops + needs_guard_ip + 3 + (!OPCODE_HAS_NO_SAVE_IP(opcode)), "uop and various checks");
+    // _GUARD_IP leads to an exit.
+    max_length -= needs_guard_ip;
+
+    RESERVE_RAW(expansion->nuops + needs_guard_ip + 2 + (!OPCODE_HAS_NO_SAVE_IP(opcode)), "uop and various checks");
 
     ADD_TO_TRACE(_CHECK_VALIDITY, 0, 0, target);