Skip to content

Commit e35b1e9

Browse files
committed
Workaround Risc-V code gen problem causing Python interpreter crash.
1 parent 88f6117 commit e35b1e9

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

shared/runtime/pyexec.c

+3-1
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,9 @@ static int parse_compile_execute(const void *source, mp_parse_input_kind_t input
9090

9191
nlr_buf_t nlr;
9292
nlr.ret_val = NULL;
93+
// CIRCUITPY-CHANGE
94+
mp_obj_t module_fun = mp_const_none;
9395
if (nlr_push(&nlr) == 0) {
94-
mp_obj_t module_fun = mp_const_none;
9596
// CIRCUITPY-CHANGE
9697
#if CIRCUITPY_ATEXIT
9798
if (!(exec_flags & EXEC_FLAG_SOURCE_IS_ATEXIT))
@@ -157,6 +158,7 @@ static int parse_compile_execute(const void *source, mp_parse_input_kind_t input
157158
mp_call_function_n_kw(callback->func, callback->n_pos, callback->n_kw, callback->args);
158159
} else
159160
#endif
161+
// CIRCUITPY-CHANGE
160162
if (module_fun != mp_const_none) {
161163
mp_call_function_0(module_fun);
162164
}

0 commit comments

Comments
 (0)