From 077cd4970c45e73f368298eb71bcce01a5a4c19d Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Tue, 29 Oct 2019 13:45:04 -0700 Subject: [PATCH] Handle empty list of included ranges w/ non-null pointer --- lib/src/lexer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/src/lexer.c b/lib/src/lexer.c index 0a223464..a6d99546 100644 --- a/lib/src/lexer.c +++ b/lib/src/lexer.c @@ -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; }