55 .text
66
77/* uint nlr_push(rdi=nlr_buf_t *nlr) */
8+ #ifndef __apple_build_version__
89 .globl nlr_push
910 .type nlr_push, @function
1011nlr_push:
12+ #else
13+ .globl _nlr_push
14+ _nlr_push:
15+ #endif
1116 movq (%rsp ), %rax # load return %rip
1217 movq %rax , 16 (%rdi ) # store %rip into nlr_buf
1318 movq %rbp , 24 (%rdi ) # store %rbp into nlr_buf
@@ -22,22 +27,36 @@ nlr_push:
2227 movq %rdi , nlr_top(%rip ) # stor new nlr_buf (to make linked list)
2328 xorq %rax , %rax # return 0, normal return
2429 ret # return
30+ #ifndef __apple_build_version__
2531 .size nlr_push, .-nlr_push
32+ #endif
2633
2734/* void nlr_pop() */
35+ #ifndef __apple_build_version__
2836 .globl nlr_pop
2937 .type nlr_pop, @function
3038nlr_pop:
39+ #else
40+ .globl _nlr_pop
41+ _nlr_pop:
42+ #endif
3143 movq nlr_top(%rip ), %rax # get nlr_top into %rax
3244 movq (%rax ), %rax # load prev nlr_buf
3345 movq %rax , nlr_top(%rip ) # store prev nlr_buf (to unlink list)
3446 ret # return
47+ #ifndef __apple_build_version__
3548 .size nlr_pop, .-nlr_pop
49+ #endif
3650
3751/* void nlr_jump(rdi=uint val) */
52+ #ifndef __apple_build_version__
3853 .globl nlr_jump
3954 .type nlr_jump, @function
4055nlr_jump:
56+ #else
57+ .globl _nlr_jump
58+ _nlr_jump:
59+ #endif
4160 movq %rdi , %rax # put return value in %rax
4261 movq nlr_top(%rip ), %rdi # get nlr_top into %rdi
4362 movq %rax , 8 (%rdi ) # store return value
@@ -55,8 +74,12 @@ nlr_jump:
5574 xorq %rax , %rax # clear return register
5675 inc %al # increase to make 1, non-local return
5776 ret # return
77+ #ifndef __apple_build_version__
5878 .size nlr_jump, .-nlr_jump
79+ #endif
5980
81+ #ifndef __apple_build_version__
6082 .local nlr_top
83+ #endif
6184 .comm nlr_top,8 ,8
6285#endif
0 commit comments