mirror of
https://github.com/micropython/micropython.git
synced 2026-01-06 12:10:13 +01:00
py: Fix stack underflow with optimised for loop.
This commit is contained in:
6
py/vm.c
6
py/vm.c
@@ -159,8 +159,8 @@ mp_vm_return_kind_t mp_execute_bytecode(const byte *code, const mp_obj_t *args,
|
||||
|
||||
#if DETECT_VM_STACK_OVERFLOW
|
||||
if (vm_return_kind == MP_VM_RETURN_NORMAL) {
|
||||
if (sp != state) {
|
||||
printf("Stack misalign: %d\n", sp - state);
|
||||
if (sp < state) {
|
||||
printf("VM stack underflow: " INT_FMT "\n", sp - state);
|
||||
assert(0);
|
||||
}
|
||||
}
|
||||
@@ -178,7 +178,7 @@ mp_vm_return_kind_t mp_execute_bytecode(const byte *code, const mp_obj_t *args,
|
||||
}
|
||||
}
|
||||
if (overflow) {
|
||||
printf("VM stack overflow state=%p n_state+1=%u\n", state, n_state);
|
||||
printf("VM stack overflow state=%p n_state+1=" UINT_FMT "\n", state, n_state);
|
||||
assert(0);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user