From 6370b5225a9ad88aadd3fc3ac2ee63c17d79f642 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Wed, 1 Nov 2017 13:24:19 -0700 Subject: py: Prevent crash with LTO. The protected single function call saves stack values and LTO breaks the expectations of nlr_push and pop. --- py/runtime_utils.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/py/runtime_utils.c b/py/runtime_utils.c index a5c5403ba..bcf3cbf7b 100644 --- a/py/runtime_utils.c +++ b/py/runtime_utils.c @@ -25,9 +25,10 @@ * THE SOFTWARE. */ +#include "py/mpconfig.h" #include "py/runtime.h" -void mp_call_function_1_protected(mp_obj_t fun, mp_obj_t arg) { +MP_NOINLINE void mp_call_function_1_protected(mp_obj_t fun, mp_obj_t arg) { nlr_buf_t nlr; if (nlr_push(&nlr) == 0) { mp_call_function_1(fun, arg); -- cgit v1.2.3