diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2016-08-11 19:53:30 -0400 |
---|---|---|
committer | Steve Hay <steve.m.hay@googlemail.com> | 2017-08-09 13:22:35 +0100 |
commit | 559bb126ed8b27d5f85a10919d0f0627115a47c3 (patch) | |
tree | d5cb9c58c35410dc2a36c21c69d508f51c705e3b /sv.c | |
parent | 2d197ba4766455fd01a1e589fbed44e038068de6 (diff) | |
download | perl-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.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -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 |