fix(lib): check point, byte ranges in node_descendant_for
functions
This commit is contained in:
parent
5b5cf5a5e5
commit
8c802da174
1 changed files with 6 additions and 0 deletions
|
|
@ -348,6 +348,9 @@ static inline TSNode ts_node__descendant_for_byte_range(
|
|||
uint32_t range_end,
|
||||
bool include_anonymous
|
||||
) {
|
||||
if (range_start > range_end) {
|
||||
return ts_node__null();
|
||||
}
|
||||
TSNode node = self;
|
||||
TSNode last_visible_node = self;
|
||||
|
||||
|
|
@ -391,6 +394,9 @@ static inline TSNode ts_node__descendant_for_point_range(
|
|||
TSPoint range_end,
|
||||
bool include_anonymous
|
||||
) {
|
||||
if (point_gt(range_start, range_end)) {
|
||||
return ts_node__null();
|
||||
}
|
||||
TSNode node = self;
|
||||
TSNode last_visible_node = self;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue