Handle empty list of included ranges w/ non-null pointer

This commit is contained in:
Max Brunsfeld 2019-10-29 13:45:04 -07:00
parent d5dc4bbcaa
commit 077cd4970c

View file

@ -296,7 +296,7 @@ static const TSRange DEFAULT_RANGES[] = {
};
void ts_lexer_set_included_ranges(Lexer *self, const TSRange *ranges, uint32_t count) {
if (!ranges) {
if (count == 0 || !ranges) {
ranges = DEFAULT_RANGES;
count = 1;
}