File tree 1 file changed +4
-1
lines changed
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
91
91
nlr_buf_t nlr ;
92
92
nlr .ret_val = NULL ;
93
93
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 ;
95
97
// CIRCUITPY-CHANGE
96
98
#if CIRCUITPY_ATEXIT
97
99
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
157
159
mp_call_function_n_kw (callback -> func , callback -> n_pos , callback -> n_kw , callback -> args );
158
160
} else
159
161
#endif
162
+ // CIRCUITPY-CHANGE
160
163
if (module_fun != mp_const_none ) {
161
164
mp_call_function_0 (module_fun );
162
165
}
You can’t perform that action at this time.
0 commit comments