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
commit2dd44160458c9d8293faddf5156b9cef08eea7c0 (patch)
tree7ce034b4147f721b42ff1281772878faf75d825f
parent8f3fc9e55be629c18e73e674555004c87004cfec (diff)
downloadtxr-2dd44160458c9d8293faddf5156b9cef08eea7c0.tar.gz
txr-2dd44160458c9d8293faddf5156b9cef08eea7c0.tar.bz2
txr-2dd44160458c9d8293faddf5156b9cef08eea7c0.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