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 --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);
     }
-- 
2.30.2

Reply via email to