Skip to content

Commit af61a1a

Browse files
pfalconchipaca
authored andcommitted
Use constructor to create small int (avoid exposing mp_obj_t internals to VM).
1 parent b6e9c7c commit af61a1a

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

py/vm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ bool mp_execute_byte_code_2(const byte **ip_in_out, mp_obj_t *fastn, mp_obj_t **
106106
case MP_BC_LOAD_CONST_SMALL_INT:
107107
unum = (ip[0] | (ip[1] << 8) | (ip[2] << 16)) - 0x800000;
108108
ip += 3;
109-
PUSH((mp_obj_t)(unum << 1 | 1));
109+
PUSH(MP_OBJ_NEW_SMALL_INT(unum));
110110
break;
111111

112112
case MP_BC_LOAD_CONST_DEC:

0 commit comments

Comments
 (0)