summaryrefslogtreecommitdiff
path: root/sv.c
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2016-08-11 19:53:30 -0400
committerSteve Hay <steve.m.hay@googlemail.com>2017-08-09 13:22:35 +0100
commit559bb126ed8b27d5f85a10919d0f0627115a47c3 (patch)
treed5cb9c58c35410dc2a36c21c69d508f51c705e3b /sv.c
parent2d197ba4766455fd01a1e589fbed44e038068de6 (diff)
downloadperl-559bb126ed8b27d5f85a10919d0f0627115a47c3.tar.gz
Fix on top of 75326c48.
Worked partly accidentally, and as a bonus caused asan off-stack-variable read violations. (cherry picked from commit 5208a0305e9e82c534fa034515d54a0409dfcc77)
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 3484539459..69ff4aa06a 100644
--- a/sv.c
+++ b/sv.c
@@ -12525,12 +12525,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