From be6d8be91e133e98117025062df0e63aaf87efd2 Mon Sep 17 00:00:00 2001 From: Damien George Date: Fri, 5 Dec 2014 23:13:52 +0000 Subject: 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. --- stmhal/modusocket.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'stmhal') diff --git a/stmhal/modusocket.c b/stmhal/modusocket.c index 1c0b036d3..d705636c1 100644 --- a/stmhal/modusocket.c +++ b/stmhal/modusocket.c @@ -288,7 +288,7 @@ STATIC mp_obj_t socket_setsockopt(mp_uint_t n_args, const mp_obj_t *args) { const void *optval; mp_uint_t optlen; if (mp_obj_is_integer(args[3])) { - int val = mp_obj_int_get(args[3]); + mp_int_t val = mp_obj_int_get_truncated(args[3]); optval = &val; optlen = sizeof(val); } else { -- cgit v1.2.3