py: Fix check of small-int overflow when parsing ints.
Also unifies use of SMALL_INT_FITS macro across parser and runtime.
diff --git a/py/objint_mpz.c b/py/objint_mpz.c
index 733dc09..9cdbb71 100644
--- a/py/objint_mpz.c
+++ b/py/objint_mpz.c
@@ -35,6 +35,7 @@
#include "qstr.h"
#include "parsenumbase.h"
#include "obj.h"
+#include "smallint.h"
#include "mpz.h"
#include "objint.h"
#include "runtime0.h"
@@ -239,7 +240,7 @@
}
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);