This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
toke.c: Convert sv_grow to SvGROW
authorKarl Williamson <khw@cpan.org>
Wed, 28 Dec 2016 02:45:07 +0000 (19:45 -0700)
committerKarl Williamson <khw@cpan.org>
Tue, 3 Jan 2017 04:46:38 +0000 (21:46 -0700)
The latter is preferred

toke.c

diff --git a/toke.c b/toke.c
index 7887907..a0e3643 100644 (file)
--- a/toke.c
+++ b/toke.c
@@ -3427,7 +3427,7 @@ S_scan_const(pTHX_ char *start)
                                             + 1;
                         if (UNLIKELY(needed > SvLEN(sv))) {
                             SvCUR_set(sv, d - SvPVX_const(sv));
-                            d = sv_grow(sv, needed) + SvCUR(sv);
+                            d = SvCUR(sv) + SvGROW(sv, needed);
                         }
 
                        d = (char*)uvchr_to_utf8((U8*)d, uv);