summaryrefslogtreecommitdiff
path: root/utf8.c
diff options
context:
space:
mode:
Diffstat (limited to 'utf8.c')
-rw-r--r--utf8.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/utf8.c b/utf8.c
index c78ce84ab5..7f26c8645c 100644
--- a/utf8.c
+++ b/utf8.c
@@ -817,7 +817,10 @@ Perl_is_utf8_char_helper(const U8 * const s, const U8 * e, const U32 flags)
assert(0 == (flags & ~(UTF8_DISALLOW_ILLEGAL_INTERCHANGE
|UTF8_DISALLOW_PERL_EXTENDED)));
- assert(! UTF8_IS_INVARIANT(*s));
+
+ if (UTF8_IS_INVARIANT(*s)) {
+ return 1;
+ }
/* A variant char must begin with a start byte */
if (UNLIKELY(! UTF8_IS_START(*s))) {