summaryrefslogtreecommitdiffstatshomepage
path: root/py/vm.c
diff options
context:
space:
mode:
authorPaul Sokolovsky <pfalcon@users.sourceforge.net>2014-01-06 17:49:46 +0200
committerJohn R. Lenton <jlenton@gmail.com>2014-01-07 22:51:08 +0000
commitaf61a1a4923924b9868d488e2e76126a9fc14069 (patch)
tree8e50da1b13def2e48ee4f2d2fd5d16bd9ab9f3f2 /py/vm.c
parentb6e9c7c6970971cc0aeadd38cdf287352c97ddf6 (diff)
downloadmicropython-af61a1a4923924b9868d488e2e76126a9fc14069.tar.gz
micropython-af61a1a4923924b9868d488e2e76126a9fc14069.zip
Use constructor to create small int (avoid exposing mp_obj_t internals to VM).
Diffstat (limited to 'py/vm.c')
-rw-r--r--py/vm.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/py/vm.c b/py/vm.c
index 8e7ef7485b..5e3ec0baf8 100644
--- a/py/vm.c
+++ b/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: