Skip to content

Commit 8a04a3c

Browse files
committed
Merge remote-tracking branch 'origin/main' into main
2 parents 9eed85d + 623b935 commit 8a04a3c

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

py/nlraarch64.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,13 @@
3434
// Implemented purely as inline assembly; inside a function, we have to deal with undoing the prologue, restoring
3535
// SP and LR. This way, we don't.
3636
__asm(
37+
#if defined(__APPLE__) && defined(__MACH__)
38+
"_nlr_push: \n"
39+
".global _nlr_push \n"
40+
#else
3741
"nlr_push: \n"
3842
".global nlr_push \n"
43+
#endif
3944
"mov x9, sp \n"
4045
"stp lr, x9, [x0, #16]\n" // 16 == offsetof(nlr_buf_t, regs)
4146
"stp x19, x20, [x0, #32]\n"
@@ -44,7 +49,11 @@ __asm(
4449
"stp x25, x26, [x0, #80]\n"
4550
"stp x27, x28, [x0, #96]\n"
4651
"str x29, [x0, #112]\n"
52+
#if defined(__APPLE__) && defined(__MACH__)
53+
"b _nlr_push_tail \n" // do the rest in C
54+
#else
4755
"b nlr_push_tail \n" // do the rest in C
56+
#endif
4857
);
4958

5059
NORETURN void nlr_jump(void *val) {

0 commit comments

Comments
 (0)