From 8087887afd9f661a797eb50e6ed24b03a5e12dba Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Tue, 20 Dec 2022 22:18:43 -0500 Subject: [PATCH] Use returns_twice attribute to preserve regs in nlrthumb nlr_push() --- py/nlrthumb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py/nlrthumb.c b/py/nlrthumb.c index 30f9f2c196234..4b20d30c6ef8f 100644 --- a/py/nlrthumb.c +++ b/py/nlrthumb.c @@ -36,7 +36,7 @@ // For reference, arm/thumb callee save regs are: // r4-r11, r13=sp -__attribute__((naked)) unsigned int nlr_push(nlr_buf_t *nlr) { +__attribute__((naked, returns_twice)) unsigned int nlr_push(nlr_buf_t *nlr) { __asm volatile ( "str r4, [r0, #12] \n" // store r4 into nlr_buf