summaryrefslogtreecommitdiff
path: root/gnu
diff options
context:
space:
mode:
authorAndrew Fresh <afresh1@cvs.openbsd.org>2017-08-01 15:53:48 +0000
committerAndrew Fresh <afresh1@cvs.openbsd.org>2017-08-01 15:53:48 +0000
commit306cc52677de4e75cffd410e4013de370fc0ad2c (patch)
treeb4af90448654ba656ae664e6ddcadf8aeb8e123a /gnu
parent3d54b7e2189bab57112afe9b7e5fc2a4be9d2aaa (diff)
Zero out excess bytes in perl long doubles
From upstream commits by Niko Tyni <ntyni AT debian.org> * dd6885360b15e763e0706dc28555eea328de432d * 6b2c7479d6d33249c2385d8a36d8ee9e61e1a519 ok aja@
Diffstat (limited to 'gnu')
-rw-r--r--gnu/usr.bin/perl/Configure15
1 files changed, 7 insertions, 8 deletions
diff --git a/gnu/usr.bin/perl/Configure b/gnu/usr.bin/perl/Configure
index 27b4fd91750..72381fb3ccb 100644
--- a/gnu/usr.bin/perl/Configure
+++ b/gnu/usr.bin/perl/Configure
@@ -20490,8 +20490,8 @@ $cat >try.c <<EOP
#define DOUBLESIZE $doublesize
#$d_longdbl HAS_LONG_DOUBLE
#ifdef HAS_LONG_DOUBLE
-#define LONGDBLSIZE $longdblsize
-#define LONGDBLKIND $longdblkind
+#define LONG_DOUBLESIZE $longdblsize
+#define LONG_DOUBLEKIND $longdblkind
#endif
#$i_math I_MATH
#ifdef I_MATH
@@ -20523,16 +20523,15 @@ int main(int argc, char *argv[]) {
#ifdef HAS_LONG_DOUBLE
long double ldinf = (long double)exp(1e9);
long double ldnan = (long double)sqrt(-1.0);
-#endif
- if (argc == 2) {
- switch (argv[1][0]) {
- case '1': bytes(&dinf, sizeof(dinf)); break;
- case '2': bytes(&dnan, sizeof(dnan)); break;
-#ifdef HAS_LONG_DOUBLE
# if LONG_DOUBLEKIND == 3 || LONG_DOUBLEKIND == 4
/* the 80-bit long doubles might have garbage in their excess bytes */
memset((char *)&ldinf + 10, '\0', LONG_DOUBLESIZE - 10);
+ memset((char *)&ldnan + 10, '\0', LONG_DOUBLESIZE - 10);
# endif
+ if (argc == 2) {
+ switch (argv[1][0]) {
+ case '1': bytes(&dinf, sizeof(dinf)); break;
+ case '2': bytes(&dnan, sizeof(dnan)); break;
case '3': bytes(&ldinf, sizeof(ldinf)); break;
case '4': bytes(&ldnan, sizeof(ldnan)); break;
#endif