From cb1bf2f321b45a06447133b3db00621b7300c456 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Mon, 2 Nov 2015 12:39:28 -0500 Subject: properly access mcontext_t program counter in cancellation handler using the actual mcontext_t definition rather than an overlaid pointer array both improves correctness/readability and eliminates some ugly hacks for archs with 64-bit registers bit 32-bit program counter. also fix UB due to comparison of pointers not in a common array object. --- arch/powerpc/pthread_arch.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'arch/powerpc/pthread_arch.h') diff --git a/arch/powerpc/pthread_arch.h b/arch/powerpc/pthread_arch.h index bb7405d1..7c5c4fad 100644 --- a/arch/powerpc/pthread_arch.h +++ b/arch/powerpc/pthread_arch.h @@ -15,9 +15,8 @@ static inline struct pthread *__pthread_self() #define DTP_OFFSET 0x8000 -// offset of the PC register in mcontext_t, divided by the system wordsize // the kernel calls the ip "nip", it's the first saved value after the 32 // GPRs. -#define CANCEL_REG_IP 32 +#define MC_PC gregs[32] #define CANARY canary_at_end -- cgit v1.2.1