From d1e355ea8e2a5a17ee126f5c3d173b2e6f33e460 Mon Sep 17 00:00:00 2001 From: Damien George Date: Wed, 28 May 2014 14:51:12 +0100 Subject: py: Fix check of small-int overflow when parsing ints. Also unifies use of SMALL_INT_FITS macro across parser and runtime. --- py/objint_longlong.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'py/objint_longlong.c') diff --git a/py/objint_longlong.c b/py/objint_longlong.c index 381246dfe..82db9e660 100644 --- a/py/objint_longlong.c +++ b/py/objint_longlong.c @@ -34,6 +34,7 @@ #include "misc.h" #include "qstr.h" #include "obj.h" +#include "smallint.h" #include "mpz.h" #include "objint.h" #include "runtime0.h" @@ -140,7 +141,7 @@ mp_obj_t mp_obj_int_binary_op(int op, mp_obj_t lhs_in, mp_obj_t rhs_in) { } mp_obj_t mp_obj_new_int(machine_int_t value) { - if (MP_OBJ_FITS_SMALL_INT(value)) { + if (MP_SMALL_INT_FITS(value)) { return MP_OBJ_NEW_SMALL_INT(value); } return mp_obj_new_int_from_ll(value); -- cgit v1.2.3