diff mbox series

[committed] d: Fix regressing test failures on ix86-solaris2.11

Message ID 20211031185336.559005-1-ibuclaw@gdcproject.org
State New
Headers show
Series [committed] d: Fix regressing test failures on ix86-solaris2.11 | expand

Commit Message

Iain Buclaw Oct. 31, 2021, 6:53 p.m. UTC
Hi,

This patch fixes a regression caused by r12-3986.  The _Unwind_Exception
struct had its alignment adjusted to 16-bytes in order to be compatible
with other languages, however malloc() on Solaris X86 is not guaranteed
to allocate memory aligned to 16-bytes as well.

Bootstrapped and regression tested on x86_64-linux-gnu/-m32/-mx32, as
well as x86_64-pc-solaris2.11/-m32.  Committed to mainline.

Regards,
Iain

---
	PR d/102837

libphobos/ChangeLog:

	* libdruntime/gcc/deh.d (ExceptionHeader.free): Use memset to reset
	contents of internal EH storage.
---
 libphobos/libdruntime/gcc/deh.d | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/libphobos/libdruntime/gcc/deh.d b/libphobos/libdruntime/gcc/deh.d
index ba57fed38dc..bbc351c7805 100644
--- a/libphobos/libdruntime/gcc/deh.d
+++ b/libphobos/libdruntime/gcc/deh.d
@@ -207,7 +207,7 @@  struct ExceptionHeader
      */
     static void free(ExceptionHeader* eh) @nogc
     {
-        *eh = ExceptionHeader.init;
+        __builtin_memset(eh, 0, ExceptionHeader.sizeof);
         if (eh != &ehstorage)
             __builtin_free(eh);
     }