mirror of
https://github.com/python/cpython.git
synced 2025-12-10 11:00:14 +00:00
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
This commit is contained in:
parent
8d561092d5
commit
ea9f168957
1 changed files with 2 additions and 1 deletions
|
|
@ -261,7 +261,8 @@ _PyCode_InitOpcache(PyCodeObject *co)
|
||||||
|
|
||||||
// TODO: LOAD_METHOD, LOAD_ATTR
|
// TODO: LOAD_METHOD, LOAD_ATTR
|
||||||
if (opcode == LOAD_GLOBAL) {
|
if (opcode == LOAD_GLOBAL) {
|
||||||
co->co_opcache_map[i] = ++opts;
|
opts++;
|
||||||
|
co->co_opcache_map[i] = (unsigned char)opts;
|
||||||
if (opts > 254) {
|
if (opts > 254) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue