This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Big endian frexp+ldexp byte extraction was wrong.
authorJarkko Hietaniemi <jhi@iki.fi>
Fri, 15 Aug 2014 01:42:39 +0000 (21:42 -0400)
committerJarkko Hietaniemi <jhi@iki.fi>
Fri, 15 Aug 2014 02:38:31 +0000 (22:38 -0400)
sv.c

diff --git a/sv.c b/sv.c
index 54433af..073b721 100644 (file)
--- a/sv.c
+++ b/sv.c
@@ -11709,7 +11709,8 @@ Perl_sv_vcatpvfn_flags(pTHX_ SV *const sv, const char *const pat, const STRLEN p
                     }
 #  else
                     /* Big endian. */
-                    for (ix = 0; ix <= limit_byte; ix++) {
+                    for (ix = MANTISSASIZE - 1 - limit_byte;
+                         ix < MANTISSASIZE; ix++) {
                         *v++ = nvp[ix] >> 4;
                         *v++ = nvp[ix] & 0xF;
                     }