move things

This commit is contained in:
Ryan Voots 2022-03-06 10:51:30 -05:00
parent 5f26343d32
commit bc38a8907c
2 changed files with 42 additions and 0 deletions

View file

@ -0,0 +1,42 @@
From a2db6c92fc2880ba1f288b6c4599a779997dd4e7 Mon Sep 17 00:00:00 2001
From: Tony Cook <tony@develop-help.com>
Date: Thu, 9 Apr 2015 15:45:16 +1000
Subject: [PATCH] [perl #123971] fix long double pack padding on newer GCC
---
pp_pack.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/pp_pack.c b/pp_pack.c
index 06adade..1d732a8 100644
--- a/pp_pack.c
+++ b/pp_pack.c
@@ -2709,6 +2709,12 @@ S_pack_rec(pTHX_ SV *cat, tempsym_t* symptr, SV **beglist, SV **endlist )
#ifdef __GNUC__
/* to work round a gcc/x86 bug; don't use SvNV */
anv.nv = sv_2nv(fromstr);
+# if defined(LONGDOUBLE_X86_80_BIT) && defined(USE_LONG_DOUBLE) \
+ && LONG_DOUBLESIZE > 10
+ /* GCC sometimes overwrites the padding in the
+ assignment above */
+ Zero(anv.bytes+10, sizeof(anv.bytes) - 10, U8);
+# endif
#else
anv.nv = SvNV(fromstr);
#endif
@@ -2726,6 +2732,11 @@ S_pack_rec(pTHX_ SV *cat, tempsym_t* symptr, SV **beglist, SV **endlist )
# ifdef __GNUC__
/* to work round a gcc/x86 bug; don't use SvNV */
aldouble.ld = (long double)sv_2nv(fromstr);
+# if defined(LONGDOUBLE_X86_80_BIT) && LONG_DOUBLESIZE > 10
+ /* GCC sometimes overwrites the padding in the
+ assignment above */
+ Zero(aldouble.bytes+10, sizeof(aldouble.bytes) - 10, U8);
+# endif
# else
aldouble.ld = (long double)SvNV(fromstr);
# endif
--
1.7.10.4