From 2686f9b3e8ada0f32a095ab552b0b64602a1225c Mon Sep 17 00:00:00 2001
From: Damien George <damien.p.george@gmail.com>
Date: Wed, 1 Apr 2015 00:12:43 +0100
Subject: [PATCH] py: Fix emitnative's creation of small ints so it uses the
 macro.

---
 py/emitnative.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/py/emitnative.c b/py/emitnative.c
index 423b1684b..85eb891d4 100644
--- a/py/emitnative.c
+++ b/py/emitnative.c
@@ -1125,7 +1125,7 @@ STATIC void emit_native_load_const_small_int(emit_t *emit, mp_int_t arg) {
     if (emit->do_viper_types) {
         emit_post_push_imm(emit, VTYPE_INT, arg);
     } else {
-        emit_post_push_imm(emit, VTYPE_PYOBJ, (arg << 1) | 1);
+        emit_post_push_imm(emit, VTYPE_PYOBJ, (mp_uint_t)MP_OBJ_NEW_SMALL_INT(arg));
     }
 }
 
-- 
GitLab