summaryrefslogtreecommitdiff
path: root/sv.c
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2016-08-11 19:53:30 -0400
committerJarkko Hietaniemi <jhi@iki.fi>2016-08-11 22:51:08 -0400
commit5208a0305e9e82c534fa034515d54a0409dfcc77 (patch)
tree78c2bf136f9bda472d82d7f9c0d8210facf102be /sv.c
parent749d85343f3cdb65891a5fe3b9f55ef3a5b03ca8 (diff)
downloadperl-5208a0305e9e82c534fa034515d54a0409dfcc77.tar.gz
Fix on top of 75326c48.
Worked partly accidentally, and as a bonus caused asan off-stack-variable read violations.
Diffstat (limited to 'sv.c')
-rw-r--r--sv.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/sv.c b/sv.c
index ce1a8cefe7..ae70d7b266 100644
--- a/sv.c
+++ b/sv.c
@@ -12517,12 +12517,12 @@ Perl_sv_vcatpvfn_flags(pTHX_ SV *const sv, const char *const pat, const STRLEN p
bool overflow = FALSE;
if (v0[precis + 1] < 0x8) {
/* Round down, nothing to do. */
- } else if (v[precis + 1] > 0x8) {
+ } else if (v0[precis + 1] > 0x8) {
/* Round up. */
- v0[precis + 1]++;
- overflow = v0[precis + 1] > 0xF;
- v0[precis + 1] &= 0xF;
- } else { /* v[precis + 1] == 0x8 */
+ v0[precis]++;
+ overflow = v0[precis] > 0xF;
+ v0[precis] &= 0xF;
+ } else { /* v0[precis] == 0x8 */
/* Half-point: round towards the one
* with the even least-significant digit:
* 08 -> 0 88 -> 8