emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Protect against an infloop in python-mode


From: Philipp Stephani
Subject: Re: [PATCH] Protect against an infloop in python-mode
Date: Sun, 26 Mar 2017 18:49:18 +0000



Alan Mackenzie <address@hidden> schrieb am Fr., 24. März 2017 um 18:53 Uhr:
Hello, Philipp.

On Thu, Mar 23, 2017 at 22:08:15 +0000, Philipp Stephani wrote:
> Philipp Stephani <address@hidden> schrieb am Di., 28. Feb. 2017 um
> 22:32 Uhr:

> > There appears to be an edge case caused by using `syntax-ppss' in a
> > narrowed buffer during JIT lock inside of Python triple-quote strings.
> > Unfortunately it is impossible to reproduce without manually
> > destroying the syntactic information in the Python buffer, but it has
> > been observed in practice.  In that case it can happen that the syntax
> > caches get sufficiently out of whack so that there appear to be
> > overlapping strings in the buffer.  As Python has no nested strings,
> > this situation is impossible and leads to an infloop in
> > `python-nav-end-of-statement'.  Protect against this by checking
> > whether the search for the end of the current string makes progress.

I think it's fair to say that syntax-ppss doesn't work in narrowed
buffers.  This has been known for a long time now - I raised bug #22983
about this topic over a year ago, yet despite repeated requests from
myself, there are no signs this is going to be fixed any time soon.

I "welcome" your misfortune, as it shows that the flaws in syntax-ppss
in narrowed buffers occur in real situations, not just test cases.
Presumably, diagnosing the bug took up quite a lot of your valuable
time.

Let's get bug #22983 fixed.


Agreed. I'm not 100% positive that it's the same bug, but it's very likely. 

reply via email to

[Prev in Thread] Current Thread [Next in Thread]