summaryrefslogtreecommitdiff
path: root/pp_pack.c
diff options
context:
space:
mode:
authorTony Cook <tony@develop-help.com>2015-04-09 15:45:16 +1000
committerTony Cook <tony@develop-help.com>2015-04-10 09:51:52 +1000
commit070e2677bff654753fc8dde8b9d1ce69816dfd42 (patch)
tree28004506687ca66a46a6e2487e64c07457cbf89b /pp_pack.c
parente051d009541f9ca3c34306dc18d7638f4acfe50a (diff)
downloadperl-070e2677bff654753fc8dde8b9d1ce69816dfd42.tar.gz
[perl #123971] fix long double pack padding on newer GCC
Diffstat (limited to 'pp_pack.c')
-rw-r--r--pp_pack.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/pp_pack.c b/pp_pack.c
index 06adade1aa..1d732a8bf7 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