mirror of
https://github.com/tobast/libunwind-eh_elf.git
synced 2024-11-26 00:57:39 +01:00
Make setjmp/longjmp work at least on FreeBSD/amd64.
FreeBSD-supplied setjmp() saves incremented stack pointer into jmpbuf. I have no idea whether siglongjmp ever worked on amd64, since UNW_NUM_EH_REGS == 2 and abort at siglongjmp.c:81 is firing.
This commit is contained in:
parent
31ece3eaa1
commit
5715d912f4
2 changed files with 8 additions and 0 deletions
|
@ -50,7 +50,11 @@ _longjmp (jmp_buf env, int val)
|
|||
{
|
||||
if (unw_get_reg (&c, UNW_REG_SP, &sp) < 0)
|
||||
abort ();
|
||||
#ifdef __FreeBSD__
|
||||
if (sp != wp[JB_SP] + sizeof(unw_word_t))
|
||||
#else
|
||||
if (sp != wp[JB_SP])
|
||||
#endif
|
||||
continue;
|
||||
|
||||
if (!bsp_match (&c, wp))
|
||||
|
|
|
@ -53,7 +53,11 @@ siglongjmp (sigjmp_buf env, int val)
|
|||
{
|
||||
if (unw_get_reg (&c, UNW_REG_SP, &sp) < 0)
|
||||
abort ();
|
||||
#ifdef __FreeBSD__
|
||||
if (sp != wp[JB_SP] + sizeof(unw_word_t))
|
||||
#else
|
||||
if (sp != wp[JB_SP])
|
||||
#endif
|
||||
continue;
|
||||
|
||||
if (!bsp_match (&c, wp))
|
||||
|
|
Loading…
Reference in a new issue