We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b32a38e commit eaa7745Copy full SHA for eaa7745
py/objint.c
@@ -383,7 +383,7 @@ STATIC mp_obj_t int_from_bytes(size_t n_args, const mp_obj_t *args) {
383
384
#if MICROPY_LONGINT_IMPL != MICROPY_LONGINT_IMPL_NONE
385
// If result guaranteedly fits in small int, use that
386
- if (!MP_SMALL_INT_FITS(1 << (bufinfo.len * 8 - 1))) {
+ if (bufinfo.len >= sizeof(mp_uint_t) || !MP_SMALL_INT_FITS(1 << (bufinfo.len * 8 - 1))) {
387
return mp_obj_int_from_bytes_impl(args[2] != MP_OBJ_NEW_QSTR(MP_QSTR_little), bufinfo.len, bufinfo.buf);
388
} else
389
#endif
0 commit comments