[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] Protect against an infloop in python-mode
From: |
Alan Mackenzie |
Subject: |
Re: [PATCH] Protect against an infloop in python-mode |
Date: |
Fri, 24 Mar 2017 17:53:18 +0000 |
User-agent: |
Mutt/1.7.2 (2016-11-26) |
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.
> > * python.el (python-nav-end-of-statement): Protect against infloop.
> > * progmodes/python-tests.el
> > (python-tests--python-nav-end-of-statement--infloop): Add unit test.
> Pushed as 4fbd330fae.
--
Alan Mackenzie (Nuremberg, Germany).