From 3f0e63058bfb807adfa05a9bc3a9a7d2c2b8a6b5 Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Sat, 5 Nov 2016 21:26:01 -0700 Subject: [PATCH] Fix handling of failure to descend when getting changed ranges --- src/runtime/tree_path.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/runtime/tree_path.h b/src/runtime/tree_path.h index 63c2d760..5585040c 100644 --- a/src/runtime/tree_path.h +++ b/src/runtime/tree_path.h @@ -22,6 +22,7 @@ static void range_array_add(RangeArray *results, TSPoint start, TSPoint end) { } static bool tree_path_descend(TreePath *path, TSPoint position) { + size_t original_size = path->size; bool did_descend; do { did_descend = false; @@ -45,6 +46,7 @@ static bool tree_path_descend(TreePath *path, TSPoint position) { child_position = child_right_position; } } while (did_descend); + path->size = original_size; return false; }