Skip to content

Commit

Permalink
bpo-26219: Fix compiler warning in _PyCode_InitOpcache() (GH-13809)
Browse files Browse the repository at this point in the history
Fix this MSVC warning:

    objects\codeobject.c(264): warning C4244: '=':
    conversion from 'Py_ssize_t' to 'unsigned char', possible loss of data
  • Loading branch information
vstinner authored Jun 4, 2019
1 parent 8d56109 commit ea9f168
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Objects/codeobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit ea9f168

Please sign in to comment.