summaryrefslogtreecommitdiff
path: root/sv.c
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2016-08-12 17:36:58 -0400
committerJarkko Hietaniemi <jhi@iki.fi>2016-08-12 22:35:25 -0400
commitee58923a8531731f8acb98ab130abf41f75ebdc7 (patch)
tree4b9b0387fa28a67e464ef2a74d0a41e75d9b3559 /sv.c
parent44348173fce5aaf28fdf59ba6ace73ea435d9380 (diff)
downloadperl-ee58923a8531731f8acb98ab130abf41f75ebdc7.tar.gz
[rt.perl.org #128909] printf %a mishandles exponent-crossing rounding with long double
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 ae70d7b266..467af345f2 100644
--- a/sv.c
+++ b/sv.c
@@ -12549,12 +12549,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;
}
}