summaryrefslogtreecommitdiff
path: root/proto.h
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2016-11-01 22:12:51 -0600
committerKarl Williamson <khw@cpan.org>2016-11-02 15:49:29 -0600
commitb0b342d4b3fa61880a96b645a3dab648f7c4c682 (patch)
tree8d80cca3c0da9ef9a0a5b0989102697d4cb40022 /proto.h
parent22123136705b458f89846c8e559433731724adf7 (diff)
downloadperl-b0b342d4b3fa61880a96b645a3dab648f7c4c682.tar.gz
Fix wrong UTF-8 overflow error on 32-bit platforms
Commit 2b5e7bc2e60b4c4b5d87aa66e066363d9dce7930 changed the algorithm for detecting overflow during decoding UTF-8 into code points. However, on 32-bit platforms, this change caused it to claim some things overflow that really don't. ALl such are overlong malformations, which are normally forbidden, but not necessarily. This commit fixes that.
Diffstat (limited to 'proto.h')
-rw-r--r--proto.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/proto.h b/proto.h
index 1d79c46e2e..670801698d 100644
--- a/proto.h
+++ b/proto.h
@@ -5605,6 +5605,12 @@ PERL_STATIC_INLINE bool S_does_utf8_overflow(const U8 * const s, const U8 * e)
#define PERL_ARGS_ASSERT_DOES_UTF8_OVERFLOW \
assert(s); assert(e)
+PERL_STATIC_INLINE bool S_isFF_OVERLONG(const U8 * const s, const STRLEN len)
+ __attribute__warn_unused_result__
+ __attribute__pure__;
+#define PERL_ARGS_ASSERT_ISFF_OVERLONG \
+ assert(s)
+
PERL_STATIC_INLINE bool S_is_utf8_common(pTHX_ const U8 *const p, SV **swash, const char * const swashname, SV* const invlist)
__attribute__warn_unused_result__;
#define PERL_ARGS_ASSERT_IS_UTF8_COMMON \