From 7ceccad4e2f1e9d073f5781c32e5b377e8391a25 Mon Sep 17 00:00:00 2001 From: Bob Abeles Date: Fri, 14 May 2021 08:05:40 -0700 Subject: [PATCH] py/nlrx64: Correct the detection of Darwin ABI. __APPLE__ tests for an Apple OS and __MACH__ tests that it is based on CMU Mach. Using both tests ensures that just Darwin is recognized. --- py/nlrx64.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/py/nlrx64.c b/py/nlrx64.c index f5d02afbdb..6f006e755e 100644 --- a/py/nlrx64.c +++ b/py/nlrx64.c @@ -58,7 +58,7 @@ unsigned int nlr_push(nlr_buf_t *nlr) { #else __asm volatile ( - #if defined(__APPLE__) || defined(__MACH__) + #if defined(__APPLE__) && defined(__MACH__) "pop %rbp \n" // undo function's prelude #endif "movq (%rsp), %rax \n" // load return %rip @@ -70,7 +70,7 @@ unsigned int nlr_push(nlr_buf_t *nlr) { "movq %r13, 56(%rdi) \n" // store %r13 into nlr_buf "movq %r14, 64(%rdi) \n" // store %r14 into nlr_buf "movq %r15, 72(%rdi) \n" // store %r15 into nlr_buf - #if defined(__APPLE__) || defined(__MACH__) + #if defined(__APPLE__) && defined(__MACH__) "jmp _nlr_push_tail \n" // do the rest in C #else "jmp nlr_push_tail \n" // do the rest in C