Page MenuHomePhabricator

[Clang] Fix invalid utf-8 detection
ClosedPublic

Authored by cor3ntin on Jul 6 2022, 1:19 PM.

Details

Summary

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

Diff Detail

Event Timeline

cor3ntin created this revision.Jul 6 2022, 1:19 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 6 2022, 1:19 PM
Herald added a subscriber: hiraditya. · View Herald Transcript
cor3ntin requested review of this revision.Jul 6 2022, 1:19 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptJul 6 2022, 1:19 PM
This revision was not accepted when it landed; it landed in state Needs Review.Jul 6 2022, 1:20 PM
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
thakis added a subscriber: thakis.Jul 6 2022, 1:23 PM

This breaks check-clang: http://45.33.8.238/linux/80462/step_7.txt

Please take a look and revert for now if it takes a while to fix.

thakis added a comment.Jul 6 2022, 2:02 PM

(Also on all other bots, e.g. https://lab.llvm.org/buildbot/#/builders/171/builds/17060 – did you run tests locally before committing?)

Thanks, I was going to do that when I noticed you already did, very much appreciated.
The patch (well, the one before) appeared to have multiple off-by one errors that cancelled each other and were not caught due to insufficient test cases
Once I find a fix, I'll get it reviewed again. Sorry for the inconvenience