Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ea9f168

Browse files
authored
bpo-26219: Fix compiler warning in _PyCode_InitOpcache() (GH-13809)
Fix this MSVC warning: objects\codeobject.c(264): warning C4244: '=': conversion from 'Py_ssize_t' to 'unsigned char', possible loss of data
1 parent 8d56109 commit ea9f168

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

Objects/codeobject.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,8 @@ _PyCode_InitOpcache(PyCodeObject *co)
261261

262262
// TODO: LOAD_METHOD, LOAD_ATTR
263263
if (opcode == LOAD_GLOBAL) {
264-
co->co_opcache_map[i] = ++opts;
264+
opts++;
265+
co->co_opcache_map[i] = (unsigned char)opts;
265266
if (opts > 254) {
266267
break;
267268
}

0 commit comments

Comments
 (0)