Skip to content

Commit 3593d8e

Browse files
committed
py/nlrx64.S: Prefix mp_thread_get_state with an underscore on Mac.
1 parent e9f3fb7 commit 3593d8e

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

py/nlrx64.S

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,10 @@
3737

3838
#if defined(__APPLE__) && defined(__MACH__)
3939
#define NLR_TOP (_mp_state_ctx + NLR_TOP_OFFSET)
40+
#define MP_THREAD_GET_STATE _mp_thread_get_state
4041
#else
4142
#define NLR_TOP (mp_state_ctx + NLR_TOP_OFFSET)
43+
#define MP_THREAD_GET_STATE mp_thread_get_state
4244
#endif
4345

4446
// offset of nlr_top within mp_state_thread_t structure
@@ -87,7 +89,7 @@ _nlr_push:
8789
movq %rdi, NLR_TOP(%rip) # stor new nlr_buf (to make linked list)
8890
#else
8991
movq %rdi, %rbp # since we make a call, must save rdi in rbp
90-
callq mp_thread_get_state # get mp_state_thread ptr into rax
92+
callq MP_THREAD_GET_STATE # get mp_state_thread ptr into rax
9193
movq NLR_TOP_TH_OFF(%rax), %rsi # get thread.nlr_top (last nlr_buf)
9294
movq %rsi, (%rbp) # store it
9395
movq %rbp, NLR_TOP_TH_OFF(%rax) # store new nlr_buf (to make linked list)
@@ -117,7 +119,7 @@ _nlr_pop:
117119
movq (%rax), %rax # load prev nlr_buf
118120
movq %rax, NLR_TOP(%rip) # store prev nlr_buf (to unlink list)
119121
#else
120-
callq mp_thread_get_state # get mp_state_thread ptr into rax
122+
callq MP_THREAD_GET_STATE # get mp_state_thread ptr into rax
121123
movq NLR_TOP_TH_OFF(%rax), %rdi # get thread.nlr_top (last nlr_buf)
122124
movq (%rdi), %rdi # load prev nlr_buf
123125
movq %rdi, NLR_TOP_TH_OFF(%rax) # store prev nlr_buf (to unlink list)
@@ -150,7 +152,7 @@ nlr_jump:
150152
movq %rax, NLR_TOP(%rip) # store prev nlr_buf (to unlink list)
151153
#else
152154
movq %rdi, %rbp # put return value in rbp
153-
callq mp_thread_get_state # get thread ptr in rax
155+
callq MP_THREAD_GET_STATE # get thread ptr in rax
154156
movq %rax, %rsi # put thread ptr in rsi
155157
movq %rbp, %rax # put return value to rax (for je .fail)
156158
movq NLR_TOP_TH_OFF(%rsi), %rdi # get thread.nlr_top in rdi

0 commit comments

Comments
 (0)