summaryrefslogtreecommitdiff
path: root/utf8.c
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2016-12-07 21:08:38 -0700
committerKarl Williamson <khw@cpan.org>2016-12-23 13:21:31 -0700
commit86ae6e94ac83e2ce56c4363d483fee82c38cb7f9 (patch)
tree169f1ae319db57655c2b848c98327476fb5c4213 /utf8.c
parent75219bacf5aacd315b96083de24e82cd8238e99a (diff)
downloadperl-86ae6e94ac83e2ce56c4363d483fee82c38cb7f9.tar.gz
Die on malformed isFOO_utf8() input
At the p5p core hackathon in November 2016, it was decided to make the previous deprecation message fatal for malformed input passed to the isFOO_utf8() macros and friends.
Diffstat (limited to 'utf8.c')
-rw-r--r--utf8.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/utf8.c b/utf8.c
index 52687300bf..6b2c12856d 100644
--- a/utf8.c
+++ b/utf8.c
@@ -2425,16 +2425,12 @@ S_is_utf8_common(pTHX_ const U8 *const p, SV **swash,
* character without reading beyond the end, and pass that number on to the
* validating routine */
if (! isUTF8_CHAR(p, p + UTF8SKIP(p))) {
- if (ckWARN_d(WARN_UTF8)) {
- Perl_warner(aTHX_ packWARN2(WARN_DEPRECATED,WARN_UTF8),
- "Passing malformed UTF-8 to \"%s\" is deprecated", swashname);
- if (ckWARN(WARN_UTF8)) { /* This will output details as to the
- what the malformation is */
- utf8_to_uvchr_buf(p, p + UTF8SKIP(p), NULL);
- }
- }
- return FALSE;
+ _force_out_malformed_utf8_message(p, p + UTF8SKIP(p),
+ 0,
+ 1 /* Die */ );
+ NOT_REACHED; /* NOTREACHED */
}
+
if (!*swash) {
U8 flags = _CORE_SWASH_INIT_ACCEPT_INVLIST;
*swash = _core_swash_init("utf8",