File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -91,7 +91,9 @@ static int parse_compile_execute(const void *source, mp_parse_input_kind_t input
9191 nlr_buf_t nlr ;
9292 nlr .ret_val = NULL ;
9393 if (nlr_push (& nlr ) == 0 ) {
94- mp_obj_t module_fun = mp_const_none ;
94+ // CIRCUITPY-CHANGE: Made volatile to prevent gcc from re-ordering store of function pointer into stack frame
95+ // after call to gc_collect. For RISC-V this was causing free of the compiled function before execution.
96+ volatile mp_obj_t module_fun = mp_const_none ;
9597 // CIRCUITPY-CHANGE
9698 #if CIRCUITPY_ATEXIT
9799 if (!(exec_flags & EXEC_FLAG_SOURCE_IS_ATEXIT ))
@@ -157,6 +159,7 @@ static int parse_compile_execute(const void *source, mp_parse_input_kind_t input
157159 mp_call_function_n_kw (callback -> func , callback -> n_pos , callback -> n_kw , callback -> args );
158160 } else
159161 #endif
162+ // CIRCUITPY-CHANGE
160163 if (module_fun != mp_const_none ) {
161164 mp_call_function_0 (module_fun );
162165 }
You can’t perform that action at this time.
0 commit comments