summaryrefslogtreecommitdiff
path: root/sysdeps/x86_64/jmpbuf-unwind.h
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/x86_64/jmpbuf-unwind.h')
-rw-r--r--sysdeps/x86_64/jmpbuf-unwind.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/sysdeps/x86_64/jmpbuf-unwind.h b/sysdeps/x86_64/jmpbuf-unwind.h
index 2d1187df70..c7c0d8ac03 100644
--- a/sysdeps/x86_64/jmpbuf-unwind.h
+++ b/sysdeps/x86_64/jmpbuf-unwind.h
@@ -22,6 +22,11 @@
#include <unwind.h>
#include <sysdep.h>
+/* Test if longjmp to JMPBUF would unwind the frame
+ containing a local variable at ADDRESS. */
+#define _JMPBUF_UNWINDS(jmpbuf, address, demangle) \
+ ((void *) (address) < (void *) demangle ((jmpbuf)[JB_RSP]))
+
#define _JMPBUF_CFA_UNWINDS_ADJ(_jmpbuf, _context, _adj) \
_JMPBUF_UNWINDS_ADJ (_jmpbuf, (void *) _Unwind_GetCFA (_context), _adj)