mirror of
https://github.com/tree-sitter/tree-sitter.git
synced 2026-09-10 07:36:22 -04:00
fix(lib): check point, byte ranges in node_descendant_for
functions
This commit is contained in:
parent
5b5cf5a5e5
commit
8c802da174
|
|
@ -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…
Reference in a new issue