aboutsummaryrefslogtreecommitdiff
path: root/py/binary.h
diff options
context:
space:
mode:
authorTom McDermott <spon@wattwatchers.com.au>2019-08-05 15:15:28 +1000
committerDamien George <damien.p.george@gmail.com>2019-09-02 13:10:55 +1000
commit1022f9cc35564b216a4bcd7c65e8243c810a0ca9 (patch)
treebc2d7d12d447a63f6a4c1c9e0f862a616a9b9a80 /py/binary.h
parent12f13ee6346d8fd029fc2ecec06d50b5f7f6b252 (diff)
py/modstruct: Fix struct.unpack with unaligned offset of native type.
With this patch alignment is done relative to the start of the buffer that is being unpacked, not the raw pointer value, as per CPython. Fixes issue #3314.
Diffstat (limited to 'py/binary.h')
-rw-r--r--py/binary.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/py/binary.h b/py/binary.h
index 71182042f..092b72288 100644
--- a/py/binary.h
+++ b/py/binary.h
@@ -38,7 +38,7 @@ size_t mp_binary_get_size(char struct_type, char val_type, mp_uint_t *palign);
mp_obj_t mp_binary_get_val_array(char typecode, void *p, mp_uint_t index);
void mp_binary_set_val_array(char typecode, void *p, mp_uint_t index, mp_obj_t val_in);
void mp_binary_set_val_array_from_int(char typecode, void *p, mp_uint_t index, mp_int_t val);
-mp_obj_t mp_binary_get_val(char struct_type, char val_type, byte **ptr);
+mp_obj_t mp_binary_get_val(char struct_type, char val_type, byte *p_base, byte **ptr);
void mp_binary_set_val(char struct_type, char val_type, mp_obj_t val_in, byte **ptr);
long long mp_binary_get_int(mp_uint_t size, bool is_signed, bool big_endian, const byte *src);
void mp_binary_set_int(mp_uint_t val_sz, bool big_endian, byte *dest, mp_uint_t val);