8000 py/asmbase: Fix assertion error with viper code. · sparkfun/micropython@5ff2ae5 · GitHub
[go: up one dir, main page]

Skip to content

Commit 5ff2ae5

Browse files
jeplerdpgeorge
authored andcommitted
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 micropython#17467. Signed-off-by: Jeff Epler <jepler@gmail.com>
1 parent fc6205c commit 5ff2ae5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

py/asmbase.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ void mp_asm_base_start_pass(mp_asm_base_t *as, int pass) {
5353
} else {
5454
// allocating executable RAM is platform specific
5555
MP_PLAT_ALLOC_EXEC(as->code_offset, (void **)&as->code_base, &as->code_size);
56-
assert(as->code_base != NULL);
56+
assert(as->code_size == 0 || as->code_base != NULL);
5757
}
5858
as->pass = pass;
5959
as->suppress = false;

0 commit comments

Comments
 (0)
0