develooper Front page | perl.perl5.changes | Postings from February 2019

[perl.git] branch blead updated. v5.29.7-74-ge2e3bb6ab2

From:
Karl Williamson
Date:
February 5, 2019 16:32
Subject:
[perl.git] branch blead updated. v5.29.7-74-ge2e3bb6ab2
Message ID:
E1gr3dW-0002Sb-Ok@git.dc.perl.space
In perl.git, the branch blead has been updated

<https://perl5.git.perl.org/perl.git/commitdiff/e2e3bb6ab2dc831e06e3f552bfafd7c66ad52179?hp=9730c47616258ce7e7ec58cb5e16a1800bb5099b>

- Log -----------------------------------------------------------------
commit e2e3bb6ab2dc831e06e3f552bfafd7c66ad52179
Author: Karl Williamson <khw@cpan.org>
Date:   Mon Feb 4 22:09:31 2019 -0700

    sv_utf8_upgrade_flags_grow(): Alloc extra byte if empty
    
    People may call this expecting that the 'extra' parameter is on top of
    whatever is in there.  If something is in there, that already includes a
    NUL, but if nothing is in there, for safety, add a byte to the request.

commit f9908fb6a0a784094ae5b2ec59d55803334ef798
Author: Karl Williamson <khw@cpan.org>
Date:   Mon Feb 4 18:27:38 2019 -0700

    regcomp.c: Clarify comment

commit d595c8d9abca40e7e0a93458eec0667660fb79f3
Author: Karl Williamson <khw@cpan.org>
Date:   Mon Feb 4 22:13:16 2019 -0700

    pp.c: Clarify comment

-----------------------------------------------------------------------

Summary of changes:
 pp.c      | 2 +-
 regcomp.c | 3 ++-
 sv.c      | 3 ++-
 3 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/pp.c b/pp.c
index bf93ce76cd..b933fe75fa 100644
--- a/pp.c
+++ b/pp.c
@@ -4321,7 +4321,7 @@ PP(pp_lc)
 	SvUTF8_on(dest);
 	*d = '\0';
 	SvCUR_set(dest, d - (U8*)SvPVX_const(dest));
-    } else {	/* Not utf8 */
+    } else {	/* 'source' not utf8 */
 	if (len) {
 	    const U8 *const send = s + len;
 
diff --git a/regcomp.c b/regcomp.c
index 493729256a..66cc6e0268 100644
--- a/regcomp.c
+++ b/regcomp.c
@@ -10604,7 +10604,8 @@ Perl__invlistEQ(pTHX_ SV* const a, SV* const b, const bool complement_b)
 
 /*
  * As best we can, determine the characters that can match the start of
- * the given EXACTF-ish node.
+ * the given EXACTF-ish node.  This is for use in creating ssc nodes, so there
+ * can be false positive matches
  *
  * Returns the invlist as a new SV*; it is the caller's responsibility to
  * call SvREFCNT_dec() when done with it.
diff --git a/sv.c b/sv.c
index b3c402441a..0a4a2e531a 100644
--- a/sv.c
+++ b/sv.c
@@ -3518,7 +3518,8 @@ Perl_sv_utf8_upgrade_flags_grow(pTHX_ SV *const sv, const I32 flags, STRLEN extr
     }
 
     if (SvCUR(sv) == 0) {
-	if (extra) SvGROW(sv, extra);
+        if (extra) SvGROW(sv, extra + 1); /* Make sure is room for a trailing
+                                             byte */
     } else { /* Assume Latin-1/EBCDIC */
 	/* This function could be much more efficient if we
 	 * had a FLAG in SVs to signal if there are any variant

-- 
Perl5 Master Repository



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About