mirror of
https://github.com/micropython/micropython.git
synced 2025-07-21 13:01:10 +02:00
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>
This commit is contained in:
committed by
Damien George
parent
fc6205c4f0
commit
5ff2ae5a6c
@@ -53,7 +53,7 @@ void mp_asm_base_start_pass(mp_asm_base_t *as, int pass) {
|
|||||||
} else {
|
} else {
|
||||||
// allocating executable RAM is platform specific
|
// allocating executable RAM is platform specific
|
||||||
MP_PLAT_ALLOC_EXEC(as->code_offset, (void **)&as->code_base, &as->code_size);
|
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->pass = pass;
|
||||||
as->suppress = false;
|
as->suppress = false;
|
||||||
|
Reference in New Issue
Block a user