summaryrefslogtreecommitdiff
path: root/py/vm.c
diff options
context:
space:
mode:
Diffstat (limited to 'py/vm.c')
-rw-r--r--py/vm.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/py/vm.c b/py/vm.c
index 3a7a81697..2359f1f01 100644
--- a/py/vm.c
+++ b/py/vm.c
@@ -874,10 +874,12 @@ unwind_jump:;
code_state->sp = sp;
code_state->exc_sp = MP_TAGPTR_MAKE(exc_sp, currently_in_except_block);
mp_code_state *new_state = mp_obj_fun_bc_prepare_codestate(*sp, unum & 0xff, (unum >> 8) & 0xff, sp + 1);
- new_state->prev = code_state;
- code_state = new_state;
- nlr_pop();
- goto run_code_state;
+ if (new_state) {
+ new_state->prev = code_state;
+ code_state = new_state;
+ nlr_pop();
+ goto run_code_state;
+ }
}
#endif
SET_TOP(mp_call_function_n_kw(*sp, unum & 0xff, (unum >> 8) & 0xff, sp + 1));