bpo-26219: Fix compiler warning in _PyCode_InitOpcache() (GH-13809) · python/cpython@ea9f168 (original) (raw)

Skip to content

Provide feedback

Saved searches

Use saved searches to filter your results more quickly

Sign up

Commit ea9f168

Fix this MSVC warning: objects\codeobject.c(264): warning C4244: '=': conversion from 'Py_ssize_t' to 'unsigned char', possible loss of data

File tree

1 file changed

lines changed

1 file changed

lines changed

Original file line number Diff line number Diff line change
@@ -261,7 +261,8 @@ _PyCode_InitOpcache(PyCodeObject *co)
261 261
262 262 // TODO: LOAD_METHOD, LOAD_ATTR
263 263 if (opcode == LOAD_GLOBAL) {
264 -co->co_opcache_map[i] = ++opts;
264 +opts++;
265 +co->co_opcache_map[i] = (unsigned char)opts;
265 266 if (opts > 254) {
266 267 break;
267 268 }