summaryrefslogtreecommitdiff
path: root/sv.c
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2016-08-12 17:36:58 -0400
committerSteve Hay <steve.m.hay@googlemail.com>2017-08-09 13:23:18 +0100
commit79314a4f38d4e66f5f4f7abf4726748163c07c90 (patch)
tree9f369b1154dc97785f523591e6d1dcafaf239d2a /sv.c
parent3d1a8d12c01c9ebed0c52169733b593180901b7a (diff)
downloadperl-79314a4f38d4e66f5f4f7abf4726748163c07c90.tar.gz
[rt.perl.org #128909] printf %a mishandles exponent-crossing rounding with long double
(cherry picked from commit ee58923a8531731f8acb98ab130abf41f75ebdc7)
Diffstat (limited to 'sv.c')
-rw-r--r--sv.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sv.c b/sv.c
index 69ff4aa06a..2dd0b7a54a 100644
--- a/sv.c
+++ b/sv.c
@@ -12557,12 +12557,14 @@ Perl_sv_vcatpvfn_flags(pTHX_ SV *const sv, const char *const pat, const STRLEN p
break;
}
}
- if (v == v0 && overflow) {
+ if (v == v0 - 1 && overflow) {
/* If the overflow goes all the
* way to the front, we need to
- * insert 0x1 in front. */
+ * insert 0x1 in front, and adjust
+ * the argument. */
Move(v0, v0 + 1, vn, char);
*v0 = 0x1;
+ exponent += 4;
}
}