Skip to content

Commit 6370b52

Browse files
committed
py: Prevent crash with LTO.
The protected single function call saves stack values and LTO breaks the expectations of nlr_push and pop.
1 parent dcede57 commit 6370b52

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

py/runtime_utils.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,10 @@
2525
* THE SOFTWARE.
2626
*/
2727

28+
#include "py/mpconfig.h"
2829
#include "py/runtime.h"
2930

30-
void mp_call_function_1_protected(mp_obj_t fun, mp_obj_t arg) {
31+
MP_NOINLINE void mp_call_function_1_protected(mp_obj_t fun, mp_obj_t arg) {
3132
nlr_buf_t nlr;
3233
if (nlr_push(&nlr) == 0) {
3334
mp_call_function_1(fun, arg);

0 commit comments

Comments
 (0)