This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
parts/inc/utf8: Add hint for utf8_to_uvchr()
authorKarl Williamson <khw@cpan.org>
Sun, 21 Jul 2019 18:17:58 +0000 (12:17 -0600)
committerNicolas R <atoomic@cpan.org>
Fri, 27 Sep 2019 22:51:28 +0000 (16:51 -0600)
And a Replace pragma

(cherry picked from commit 56f6e61be8269a8a7959eae3e75dd8fbd2976aa6)
Signed-off-by: Nicolas R <atoomic@cpan.org>
dist/Devel-PPPort/parts/inc/utf8

index 46fff7f..7b781e4 100644 (file)
@@ -304,6 +304,14 @@ __UNDEFINED__  utf8_to_uvchr(s, lp)
 
 #endif
 
+/* Hint: utf8_to_uvchr
+    Use utf8_to_uvchr_buf() instead.  But ONLY if you KNOW the upper bound
+    of the input string (not resorting to using UTF8SKIP, etc., to infer it).
+    The backported utf8_to_uvchr() will do a better job to prevent most cases
+    of trying to read beyond the end of the buffer */
+
+/* Replace utf8_to_uvchr with utf8_to_uvchr_buf */
+
 #ifdef SV_NOSTEAL
    /* Older Perl versions have broken sv_len_utf8() when passed sv does not have SVf_UTF8 flag set */
    /* Also note that SvGETMAGIC() may change presence of SVf_UTF8 flag */