all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Yuan Fu <casouri@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 60054@debbugs.gnu.org
Subject: bug#60054: 29.0.60; Infinite loop when there are cyclic path in  the parse tree
Date: Thu, 15 Dec 2022 17:14:36 -0800	[thread overview]
Message-ID: <46BB7A11-4231-4549-A126-618ACBD1B60E@gmail.com> (raw)
In-Reply-To: <0998189C-4A9E-4B27-A8A0-D208D11E9A39@gmail.com>


Eli Zaretskii <eliz@gnu.org> writes:

>> From: Yuan Fu <casouri@gmail.com>
>> Date: Wed, 14 Dec 2022 12:27:58 -0800
>> Cc: 60054@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 this particular case, it is the siblings’ parent that equals to the
node. Ie, node->sibling->parent = node.  If your intention is to protect
us from this particular case, switching to use cursors will avoid this
bug.

Yuan





  parent reply	other threads:[~2022-12-16  1:14 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-14  0:11 bug#60054: 29.0.60; Infinite loop when there are cyclic path in the parse tree Yuan Fu
2022-12-14 12:08 ` Eli Zaretskii
2022-12-14 20:27   ` Yuan Fu
2022-12-15  6:16     ` Eli Zaretskii
2022-12-16  1:14 ` Yuan Fu [this message]
2022-12-17 23:28 ` Yuan Fu
2022-12-18  6:00   ` Eli Zaretskii
2022-12-18  8:10 ` Yuan Fu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=46BB7A11-4231-4549-A126-618ACBD1B60E@gmail.com \
    --to=casouri@gmail.com \
    --cc=60054@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.