diff options
author | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2017-01-17 22:50:20 +0300 |
---|---|---|
committer | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2017-01-17 22:53:06 +0300 |
commit | af9046193148084f008501434e4c9f49fedc053f (patch) | |
tree | 7a05a10f74c645a5154f877c14eebbae25bd45f3 /py/modstruct.c | |
parent | 5e80c53c115e8b45df598ffdbc45dfdd543be8ac (diff) |
py/binary: mp_binary_get_size: Raise error on unsupported typecodes.
Previouly, we had errors checked in callers, which led to duplicate code
or missing checks in some places.
Diffstat (limited to 'py/modstruct.c')
-rw-r--r-- | py/modstruct.c | 3 |
1 files changed, 0 insertions, 3 deletions
diff --git a/py/modstruct.c b/py/modstruct.c index 88411ff0f..3c99ef1d8 100644 --- a/py/modstruct.c +++ b/py/modstruct.c @@ -113,9 +113,6 @@ STATIC mp_obj_t struct_calcsize(mp_obj_t fmt_in) { } else { mp_uint_t align; size_t sz = mp_binary_get_size(fmt_type, *fmt, &align); - if (sz == 0) { - mp_raise_ValueError("unsupported format"); - } while (cnt--) { // Apply alignment size = (size + align - 1) & ~(align - 1); |