8000 Merge pull request #10301 from eightycc/issue-10298 · adafruit/circuitpython@04b17e1 · GitHub
[go: up one dir, main page]

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 04b17e1

Browse files
authored
Merge pull request #10301 from eightycc/issue-10298
8000
2 parents 4ecc0e7 + 1f5ce96 commit 04b17e1

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

shared/runtime/pyexec.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff 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
}

0 commit comments

Comments
 (0)
0