Merge pull request #1545 from trofi/glibc-2.26

src/libmain/stack.cc: fix 'ucontext' usage on glibc-2.26
This commit is contained in:
Eelco Dolstra 2017-09-01 11:12:30 +02:00 committed by GitHub
commit fe38fce2d8

View file

@ -18,9 +18,9 @@ static void sigsegvHandler(int signo, siginfo_t * info, void * ctx)
bool haveSP = true; bool haveSP = true;
char * sp = 0; char * sp = 0;
#if defined(__x86_64__) && defined(REG_RSP) #if defined(__x86_64__) && defined(REG_RSP)
sp = (char *) ((ucontext *) ctx)->uc_mcontext.gregs[REG_RSP]; sp = (char *) ((ucontext_t *) ctx)->uc_mcontext.gregs[REG_RSP];
#elif defined(REG_ESP) #elif defined(REG_ESP)
sp = (char *) ((ucontext *) ctx)->uc_mcontext.gregs[REG_ESP]; sp = (char *) ((ucontext_t *) ctx)->uc_mcontext.gregs[REG_ESP];
#else #else
haveSP = false; haveSP = false;
#endif #endif