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:
Victor Stinner 2019-06-04 17:08:24 +02:00 committed by GitHub
parent 8d561092d5
commit ea9f168957
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -261,7 +261,8 @@ _PyCode_InitOpcache(PyCodeObject *co)
// TODO: LOAD_METHOD, LOAD_ATTR
if (opcode == LOAD_GLOBAL) {
co->co_opcache_map[i] = ++opts;
opts++;
co->co_opcache_map[i] = (unsigned char)opts;
if (opts > 254) {
break;
}