From: Andreas Politz Date: Thu, 5 Oct 2017 19:55:43 +0000 (+0200) Subject: Add offsets when inspecting a node's children's values X-Git-Tag: emacs-29.0.90~1616^2~406^2~67 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=828552916eb4e14a8f3dcf83b78687f9f34b1e4b;p=emacs.git Add offsets when inspecting a node's children's values *src/itree.c (interval_tree_insert_gap): Add offset. --- diff --git a/src/itree.c b/src/itree.c index 0c10100eef7..5df2d8d1cc5 100644 --- a/src/itree.c +++ b/src/itree.c @@ -519,7 +519,8 @@ interval_tree_insert_gap (struct interval_tree *tree, ptrdiff_t pos, ptrdiff_t l else interval_stack_push (stack, node->right); } - if (node->left != &tree->nil && pos <= node->left->limit) + if (node->left != &tree->nil + && pos <= node->left->limit + node->left->offset) interval_stack_push (stack, node->left); /* node->begin == pos implies no front-advance. */ @@ -578,7 +579,8 @@ interval_tree_delete_gap (struct interval_tree *tree, ptrdiff_t pos, ptrdiff_t l else interval_stack_push (stack, node->right); } - if (node->left != &tree->nil && pos <= node->left->limit) + if (node->left != &tree->nil + && pos <= node->left->limit + node->left->offset) interval_stack_push (stack, node->left); if (pos < node->begin)