summaryrefslogtreecommitdiff
path: root/py
diff options
context:
space:
mode:
authorJeff Epler <jepler@gmail.com>2025-06-15 08:08:55 +0200
committerDamien George <damien@micropython.org>2025-06-16 14:02:30 +1000
commit5ff2ae5a6c955a5123082ba441ad57fe4908b690 (patch)
treea46153fb3b2d560bd3153c67b932cda4507e450c /py
parentfc6205c4f005dcc9d0560cfe1619f022db8ff12f (diff)
py/asmbase: Fix assertion error with viper code.
In the case of viper code it's possible to reach MP_ASM_PASS_EMIT with a code size of 0 bytes. Update the assertion accordingly. After this change, `mpy-cross -march=debug' on viper tests no longer crashes. Fixes issue #17467. Signed-off-by: Jeff Epler <jepler@gmail.com>
Diffstat (limited to 'py')
-rw-r--r--py/asmbase.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/py/asmbase.c b/py/asmbase.c
index 3fce543a7..f1b823fa3 100644
--- a/py/asmbase.c
+++ b/py/asmbase.c
@@ -53,7 +53,7 @@ void mp_asm_base_start_pass(mp_asm_base_t *as, int pass) {
} else {
// allocating executable RAM is platform specific
MP_PLAT_ALLOC_EXEC(as->code_offset, (void **)&as->code_base, &as->code_size);
- assert(as->code_base != NULL);
+ assert(as->code_size == 0 || as->code_base != NULL);
}
as->pass = pass;
as->suppress = false;