[Python-checkins] Fix MSVC compiler warnings in ceval.c (#93569)
markshannon
webhook-mailer at python.org
Tue Jun 7 06:32:55 EDT 2022
https://github.com/python/cpython/commit/75260925ecae690434ed2c5502761f1f0bce11eb
commit: 75260925ecae690434ed2c5502761f1f0bce11eb
branch: main
author: Ken Jin <kenjin4096 at gmail.com>
committer: markshannon <mark at hotpy.org>
date: 2022-06-07T11:32:42+01:00
summary:
Fix MSVC compiler warnings in ceval.c (#93569)
files:
M Python/ceval.c
diff --git a/Python/ceval.c b/Python/ceval.c
index d1480ac190ea4..0e8186347cd89 100644
--- a/Python/ceval.c
+++ b/Python/ceval.c
@@ -4581,7 +4581,7 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, _PyInterpreterFrame *frame, int
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 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, _PyInterpreterFrame *frame, int
_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 */
More information about the Python-checkins
mailing list