Call CharClassBuilder::RemoveAbove() consistently.
By calling it from Regexp::ParseState::PushRegexp(), we cover every use
of character classes. Previously, Unicode groups were not covered, which
meant that handling them in Latin-1 mode would have bizarre results. As
of this commit, the resulting character classes may be empty and, if so,
simplified to NoMatch. I would argue that this is the expected behaviour
under such nonsensical circumstances.
This bug was discovered by the LLVM fuzzer.
Reviewed-by: Russ Cox <firstname.lastname@example.org>
2 files changed