Skip to content

Commit bb13a22

Browse files
bulk88khwilliamson
authored andcommitted
toke.c: Use_SvGrow_return
Prior to this commit, the return from SvGROW() was ignored, and the value re-derived a few lines later. This commit was extracted from GH #23533
1 parent a7f3f23 commit bb13a22

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

toke.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11751,9 +11751,11 @@ Perl_scan_str(pTHX_ char *start, int keep_bracketed_quoted, int keep_delims, int
1175111751
s += delim_byte_len;
1175211752
for (;;) {
1175311753
/* extend sv if need be */
11754-
SvGROW(sv, SvCUR(sv) + (PL_bufend - s) + 1);
11754+
11755+
STRLEN sv_len = SvCUR(sv);
11756+
char * pv = SvGROW(sv, sv_len + (PL_bufend - s) + 1);
1175511757
/* set 'to' to the next character in the sv's string */
11756-
to = SvPVX(sv)+SvCUR(sv);
11758+
to = pv + sv_len;
1175711759

1175811760
/* read until we run out of string, or we find the closing delimiter */
1175911761
while (s < PL_bufend) {

0 commit comments

Comments
 (0)