summaryrefslogtreecommitdiff
path: root/py/objint.c
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2014-09-10 22:10:33 +0100
committerDamien George <damien.p.george@gmail.com>2014-09-10 22:10:33 +0100
commit953074315e594f5a30f455dc6a1a67340a3e6ea7 (patch)
tree9bce234da3c55224ee5cb6edd9cfd830be3e7960 /py/objint.c
parent6eae861685e8860e7542097ad20f69168e639a93 (diff)
py: Enable struct/binary-helper to parse q and Q sized ints.
Addresses issue #848.
Diffstat (limited to 'py/objint.c')
-rw-r--r--py/objint.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/py/objint.c b/py/objint.c
index a5392273c..240be3283 100644
--- a/py/objint.c
+++ b/py/objint.c
@@ -246,6 +246,12 @@ mp_obj_t mp_obj_new_int_from_ll(long long val) {
return mp_const_none;
}
+// This is called when an integer larger than a SMALL_INT is needed (although val might still fit in a SMALL_INT)
+mp_obj_t mp_obj_new_int_from_ull(unsigned long long val) {
+ nlr_raise(mp_obj_new_exception_msg(&mp_type_OverflowError, "small int overflow"));
+ return mp_const_none;
+}
+
mp_obj_t mp_obj_new_int_from_uint(mp_uint_t value) {
// SMALL_INT accepts only signed numbers, of one bit less size
// then word size, which totals 2 bits less for unsigned numbers.