Skip to content

Commit 1d9f041

Browse files
committed
utf8n_to_uvchr_msgs_helper: Add assertion
Make sure it isn't being called with unexpected input --
1 parent f22cd66 commit 1d9f041

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

utf8.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1459,6 +1459,10 @@ Perl__utf8n_to_uvchr_msgs_helper(const U8 *s,
14591459
expectlen = UTF8SKIP(s);
14601460
uv = *s;
14611461

1462+
/* This is a helper function; invariants should have been handled before
1463+
* calling it */
1464+
assert(! NATIVE_BYTE_IS_INVARIANT(*s0));
1465+
14621466
/* A well-formed UTF-8 character, as the vast majority of calls to this
14631467
* function will be for, has this expected length. For efficiency, set
14641468
* things up here to return it. It will be overridden only in those rare

0 commit comments

Comments
 (0)