diff options
author | Karl Williamson <khw@cpan.org> | 2018-06-11 12:58:25 -0600 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2018-07-01 18:33:49 -0600 |
commit | fdb72414df25d6fe008ccc6053e263c671fa93b0 (patch) | |
tree | d5e10921208a5527c4dda9d329d9404732d8ea89 /utf8.h | |
parent | ff58ca57f8442a7e2e74ab4a79a9e542f9a180e7 (diff) | |
download | perl-fdb72414df25d6fe008ccc6053e263c671fa93b0.tar.gz |
utf8.h: Add assert for utf8n_to_uvchr_buf()
The Perl_utf8n_to_uvchr_buf() version of this function has an assert;
this adds it as well to the macro that bypasses the function.
Diffstat (limited to 'utf8.h')
-rw-r--r-- | utf8.h | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -74,8 +74,9 @@ the string is invariant. #define uvchr_to_utf8_flags_msgs(d,uv,flags,msgs) \ uvoffuni_to_utf8_flags_msgs(d,NATIVE_TO_UNI(uv),flags, msgs) #define utf8_to_uvchr_buf(s, e, lenp) \ - utf8n_to_uvchr(s, (U8*)(e) - (U8*)(s), lenp, \ - ckWARN_d(WARN_UTF8) ? 0 : UTF8_ALLOW_ANY) + (__ASSERT_((U8*) (e) > (U8*) (s)) \ + utf8n_to_uvchr(s, (U8*)(e) - (U8*)(s), lenp, \ + ckWARN_d(WARN_UTF8) ? 0 : UTF8_ALLOW_ANY)) #define utf8n_to_uvchr(s, len, lenp, flags) \ utf8n_to_uvchr_error(s, len, lenp, flags, 0) #define utf8n_to_uvchr_error(s, len, lenp, flags, errors) \ |