py: Rename mp_obj_int_get to mp_obj_int_get_truncated; fix struct.pack.
mp_obj_int_get_truncated is used as a "fast path" int accessor that
doesn't check for overflow and returns the int truncated to the machine
word size, ie mp_int_t.
Use mp_obj_int_get_truncated to fix struct.pack when packing maximum word
sized values.
Addresses issues #779 and #998.
diff --git a/py/obj.c b/py/obj.c
index e581495..c869a65 100644
--- a/py/obj.c
+++ b/py/obj.c
@@ -179,7 +179,7 @@
if (hash_method[0] != MP_OBJ_NULL) {
mp_obj_t hash_val = mp_call_method_n_kw(0, 0, hash_method);
if (MP_OBJ_IS_INT(hash_val)) {
- return mp_obj_int_get(hash_val);
+ return mp_obj_int_get_truncated(hash_val);
}
}
}