GNU bug report logs -
#60054
29.0.60; Infinite loop when there are cyclic path in the parse tree
Previous Next
Reported by: Yuan Fu <casouri <at> gmail.com>
Date: Wed, 14 Dec 2022 00:12:02 UTC
Severity: normal
Found in version 29.0.60
Done: Yuan Fu <casouri <at> gmail.com>
Bug is archived. No further changes may be made.
Full log
Message #14 received at 60054 <at> debbugs.gnu.org (full text, mbox):
> From: Yuan Fu <casouri <at> gmail.com>
> Date: Wed, 14 Dec 2022 12:27:58 -0800
> Cc: 60054 <at> debbugs.gnu.org
>
> >> https://github.com/tree-sitter/tree-sitter-c/issues/119
> >>
> >> So far, I’ve only observed this in that specific edge case.
> >
> > We should have protection against that, which should be easy, right?
>
> Just to make sure, we want to use something like slow-fast pointers, where we have two pointers, and one goes twice as fast, right? That’s the one I was taught in school :-)
No, I mean protect us from inflooping by checking that the parent of a
node is not the node itself.
> In summary, I’m proposing:
> 1. I add the slow-fast pointer checks in treesit.c and treesit.el
> 2. I replace ts_node_parent/sibling/child with using cursors in tree-traversal functions in treesit.c.
SGTM, thanks.
This bug report was last modified 2 years and 238 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.