summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2021-04-20 19:05:14 -0700
committerKaz Kylheku <kaz@kylheku.com>2021-04-20 19:05:14 -0700
commit696e576040363b79fd08ddb76735db9de967779b (patch)
tree7ce034b4147f721b42ff1281772878faf75d825f
parentc863373f528ed1a3f25fd7b28fb395abd0fc66c2 (diff)
downloadtxr-696e576040363b79fd08ddb76735db9de967779b.tar.gz
txr-696e576040363b79fd08ddb76735db9de967779b.tar.bz2
txr-696e576040363b79fd08ddb76735db9de967779b.zip
clang+amd4: fix stack alignment for continuations.
* unwind.h (UW_FRAME_ALIGN): Define on __amd64__, if compiled by __clang__. This is because MMX instructions are used for manipulating the stack which require 16 byte alignment. This was discovered as a bus error crash on OpenBSD in the tests/012/cont.tl test case, acessing otherwise perfectly valid memory. The faulting address was only 8 byte aligned, not 16.
-rw-r--r--unwind.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/unwind.h b/unwind.h
index 35c2e017..a18ba351 100644
--- a/unwind.h
+++ b/unwind.h
@@ -302,7 +302,7 @@ struct uw_eval {
#endif
-#if __aarch64__
+#if __aarch64__ || (__clang__ && __amd64__)
#define UW_FRAME_ALIGN __attribute__ ((aligned (16)))
#else
#define UW_FRAME_ALIGN