--- src/common_sighandler.c.orig 2019-01-03 15:39:17 +++ src/common_sighandler.c 2024-07-15 17:48:27 @@ -58,11 +58,19 @@ # if __DARWIN_UNIX03 # ifdef __x86_64__ # define UC_IP(uc) ((void *) (uc)->uc_mcontext->__ss.__rip) +# elif defined(__arm64__) /* Apple Silicon, e.g. M1 */ +# define UC_IP(uc) ((void *) (uc)->uc_mcontext->__ss.__pc) +# elif defined(__POWERPC__) /* Both ppc and ppc64 */ +# define UC_IP(uc) ((void *) (uc)->uc_mcontext->__ss.__srr0) # else # define UC_IP(uc) ((void *) (uc)->uc_mcontext->__ss.__eip) # endif # else -# define UC_IP(uc) ((void *) (uc)->uc_mcontext->ss.eip) +# ifdef __ppc__ +# define UC_IP(uc) ((void *) (uc)->uc_mcontext->ss.srr0) +# else +# define UC_IP(uc) ((void *) (uc)->uc_mcontext->ss.eip) +# endif # endif #elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) # ifdef __x86_64__