[Clang] Fix invalid utf-8 detection
authorCorentin Jabot <corentinjabot@gmail.com>
Wed, 6 Jul 2022 20:16:22 +0000 (22:16 +0200)
committerCorentin Jabot <corentinjabot@gmail.com>
Wed, 6 Jul 2022 20:20:04 +0000 (22:20 +0200)
commitbf45e27a676d87944f1f13d5f0d0f39935fc4010
treeb02db25f6b8b11064ce9421aa229be22956dbd54
parent39ed08f8d452cda5c42c640c0a48487384eee61e
[Clang] Fix invalid utf-8 detection

The length of valid codepoints was incorrectly
calculated which was not caught before because the
absence of tests for the valid codepoints scenario.

Differential Revision: https://reviews.llvm.org/D129223
clang/test/Lexer/comment-invalid-utf8.c
llvm/lib/Support/ConvertUTF.cpp