From eeffb605f79e7f7656cc011271161de9d841cca9 Mon Sep 17 00:00:00 2001 From: "mostang.com!davidm" Date: Thu, 6 Mar 2003 06:14:36 +0000 Subject: [PATCH] Include . (_longjmp): Ensure that we have at least 4 exception-handling args. (This code will need updating to make it work on x86, where only 2 exception handling args are available). (Logical change 1.59) --- src/siglongjmp.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/siglongjmp.c b/src/siglongjmp.c index 97624108..9d87e927 100644 --- a/src/siglongjmp.c +++ b/src/siglongjmp.c @@ -25,6 +25,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #define UNW_LOCAL_ONLY +#include #include #include #include @@ -83,9 +84,11 @@ siglongjmp (sigjmp_buf env, int val) mp = (unw_word_t *) ¤t_mask; } - if (unw_set_reg (&c, UNW_REG_EH_ARG0, wp[1]) < 0 - || unw_set_reg (&c, UNW_REG_EH_ARG1, val) < 0 - || unw_set_reg (&c, UNW_REG_EH_ARG2, mp[0]) < 0 + assert (UNW_NUM_EH_REGS >= 4); + + if (unw_set_reg (&c, UNW_REG_EH + 0, wp[1]) < 0 + || unw_set_reg (&c, UNW_REG_EH + 1, val) < 0 + || unw_set_reg (&c, UNW_REG_EH + 2, mp[0]) < 0 || unw_set_reg (&c, UNW_REG_IP, (unw_word_t) &_UI_siglongjmp_cont)) abort (); @@ -94,7 +97,7 @@ siglongjmp (sigjmp_buf env, int val) { if (_NSIG > 16 * sizeof (unw_word_t)) abort (); - if (unw_set_reg (&c, UNW_REG_EH_ARG3, mp[1]) < 0) + if (unw_set_reg (&c, UNW_REG_EH + 3, mp[1]) < 0) abort (); }