https://github.com/python/cpython/commit/c7e9919df02e5bd6f61d86907bb54de4be981bb0
commit: c7e9919df02e5bd6f61d86907bb54de4be981bb0
branch: main
author: Wulian233 <[email protected]>
committer: Fidget-Spinner <[email protected]>
date: 2026-04-15T12:22:55Z
summary:

gh-131798: Fix `_ITER_CHECK_RANGE`  type in the JIT (#148607)

files:
M Python/optimizer_bytecodes.c
M Python/optimizer_cases.c.h

diff --git a/Python/optimizer_bytecodes.c b/Python/optimizer_bytecodes.c
index d7d8b90ebabd6d..7ffd835ad120c9 100644
--- a/Python/optimizer_bytecodes.c
+++ b/Python/optimizer_bytecodes.c
@@ -1468,11 +1468,11 @@ dummy_func(void) {
     }
 
     op(_ITER_CHECK_RANGE, (iter, null_or_index -- iter, null_or_index)) {
-        if (sym_matches_type(iter, &PyRange_Type)) {
+        if (sym_matches_type(iter, &PyRangeIter_Type)) {
             ADD_OP(_NOP, 0, 0);
         }
         else {
-            sym_set_type(iter, &PyRange_Type);
+            sym_set_type(iter, &PyRangeIter_Type);
         }
     }
 
diff --git a/Python/optimizer_cases.c.h b/Python/optimizer_cases.c.h
index bc6391d85d76cd..d2caa6fc7a7882 100644
--- a/Python/optimizer_cases.c.h
+++ b/Python/optimizer_cases.c.h
@@ -3543,11 +3543,11 @@
         case _ITER_CHECK_RANGE: {
             JitOptRef iter;
             iter = stack_pointer[-2];
-            if (sym_matches_type(iter, &PyRange_Type)) {
+            if (sym_matches_type(iter, &PyRangeIter_Type)) {
                 ADD_OP(_NOP, 0, 0);
             }
             else {
-                sym_set_type(iter, &PyRange_Type);
+                sym_set_type(iter, &PyRangeIter_Type);
             }
             break;
         }

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]

Reply via email to