diff options
author | Damien George <damien.p.george@gmail.com> | 2019-11-30 23:00:56 +1100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2019-12-12 20:15:28 +1100 |
commit | 9ac949cdbd78d15f5edeaa651859659e8b382181 (patch) | |
tree | 39e4f68575cd35a86b6c2dc3fc15e6c4a870b0b5 /py/persistentcode.c | |
parent | 42c1aed2bba55b759e54139421044a05ccd4bfc6 (diff) | |
download | micropython-9ac949cdbd78d15f5edeaa651859659e8b382181.tar.gz micropython-9ac949cdbd78d15f5edeaa651859659e8b382181.zip |
py/persistentcode: Make ARM Thumb archs support multiple sub-archs.
Diffstat (limited to 'py/persistentcode.c')
-rw-r--r-- | py/persistentcode.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/py/persistentcode.c b/py/persistentcode.c index 1e3b5368b4..8bf46202ba 100644 --- a/py/persistentcode.c +++ b/py/persistentcode.c @@ -526,9 +526,11 @@ mp_raw_code_t *mp_raw_code_load(mp_reader_t *reader) { || read_uint(reader, NULL) > QSTR_WINDOW_SIZE) { mp_raise_ValueError("incompatible .mpy file"); } - if (MPY_FEATURE_DECODE_ARCH(header[2]) != MP_NATIVE_ARCH_NONE - && MPY_FEATURE_DECODE_ARCH(header[2]) != MPY_FEATURE_ARCH) { - mp_raise_ValueError("incompatible .mpy arch"); + if (MPY_FEATURE_DECODE_ARCH(header[2]) != MP_NATIVE_ARCH_NONE) { + byte arch = MPY_FEATURE_DECODE_ARCH(header[2]); + if (!MPY_FEATURE_ARCH_TEST(arch)) { + mp_raise_ValueError("incompatible .mpy arch"); + } } qstr_window_t qw; qw.idx = 0; |