Use constructor to create small int (avoid exposing mp_obj_t internals to VM).
This commit is contained in:
parent
e03c0533fe
commit
e5ee1693ad
2
py/vm.c
2
py/vm.c
|
@ -106,7 +106,7 @@ bool mp_execute_byte_code_2(const byte **ip_in_out, mp_obj_t *fastn, mp_obj_t **
|
|||
case MP_BC_LOAD_CONST_SMALL_INT:
|
||||
unum = (ip[0] | (ip[1] << 8) | (ip[2] << 16)) - 0x800000;
|
||||
ip += 3;
|
||||
PUSH((mp_obj_t)(unum << 1 | 1));
|
||||
PUSH(MP_OBJ_NEW_SMALL_INT(unum));
|
||||
break;
|
||||
|
||||
case MP_BC_LOAD_CONST_DEC:
|
||||
|
|
Loading…
Reference in New Issue