diff --git a/regexec.c b/regexec.c index 47073dc720419..4b21a0cb2be25 100644 --- a/regexec.c +++ b/regexec.c @@ -615,8 +615,9 @@ S_isFOO_utf8_lc(pTHX_ const U8 classnum, const U8* character, const U8* e) case CC_ENUM_XDIGIT_: return is_XDIGIT_high(character); case CC_ENUM_VERTSPACE_: return is_VERTWS_high(character); default: - return _invlist_contains_cp(PL_XPosix_ptrs[classnum], - utf8_to_uvchr_buf(character, e, NULL)); + UV cp; + return utf8_to_uv(character, e, &cp, NULL) + && _invlist_contains_cp(PL_XPosix_ptrs[classnum], cp); } NOT_REACHED; /* NOTREACHED */ }