]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Fix MSVC compiler warnings in ceval.c (#93569)
authorKen Jin <kenjin4096@gmail.com>
Tue, 7 Jun 2022 10:32:42 +0000 (18:32 +0800)
committerGitHub <noreply@github.com>
Tue, 7 Jun 2022 10:32:42 +0000 (11:32 +0100)
Python/ceval.c

index d1480ac190ea412aaa75c9890415dfb8bdad9bda..0e8186347cd8957933add7f9d782038de87fa0e8 100644 (file)
@@ -4581,7 +4581,7 @@ handle_eval_breaker:
             DEOPT_IF(self_cls->tp_version_tag != read_u32(cache->type_version),
                      LOAD_METHOD);
             /* Treat index as a signed 16 bit value */
-            int dictoffset = self_cls->tp_dictoffset;
+            Py_ssize_t dictoffset = self_cls->tp_dictoffset;
             assert(dictoffset > 0);
             PyDictObject **dictptr = (PyDictObject**)(((char *)self)+dictoffset);
             PyDictObject *dict = *dictptr;
@@ -4625,7 +4625,7 @@ handle_eval_breaker:
             _PyLoadMethodCache *cache = (_PyLoadMethodCache *)next_instr;
             uint32_t type_version = read_u32(cache->type_version);
             DEOPT_IF(self_cls->tp_version_tag != type_version, LOAD_METHOD);
-            int dictoffset = self_cls->tp_dictoffset;
+            Py_ssize_t dictoffset = self_cls->tp_dictoffset;
             assert(dictoffset > 0);
             PyObject *dict = *(PyObject **)((char *)self + dictoffset);
             /* This object has a __dict__, just not yet created */