summaryrefslogtreecommitdiff
path: root/py
diff options
context:
space:
mode:
authorScott Shawcroft <scott.shawcroft@gmail.com>2017-11-01 13:24:19 -0700
committerScott Shawcroft <scott.shawcroft@gmail.com>2017-11-01 14:32:06 -0700
commit6370b5225a9ad88aadd3fc3ac2ee63c17d79f642 (patch)
tree684e51e0bf651ec8e248c27a64367bad1d103b7d /py
parentdcede575fffb9c73d2340c64efc05bd898b86923 (diff)
py: Prevent crash with LTO.
The protected single function call saves stack values and LTO breaks the expectations of nlr_push and pop.
Diffstat (limited to 'py')
-rw-r--r--py/runtime_utils.c3
1 files changed, 2 insertions, 1 deletions
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);