emacs-devel
[Top][All Lists]
Advanced

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

Another bug in CC Mode's state cache.


From: Alan Mackenzie
Subject: Another bug in CC Mode's state cache.
Date: Fri, 20 Apr 2012 20:04:50 +0000
User-agent: Mutt/1.5.21 (2010-09-15)

Hi, Yidong.

I've found and corrected another CC Mode state cache bug.  It occurred in
situations like this:

         {      }        (         {  }
         a      b        c         e  f

Insert a closing paren after c:


         {      }        (    )     {  }
         a      b        c    d     e  f

Previously, the backward search from e for a brace pair was bounded by
the paren at c.  After the insertion of d, the the paren pair c-d is
invisible to backward searching, hence the brace pair a-b is spuriously
found, leading to a cache corruption.

The solution is to use the cache's memory of c rather than the paren in
the buffer to bound the search.  This works.  I have tested it on 100,000
random points in xdisp.c and 20,000 points in lisp.h.  The results with
the new bugfix are identical to those without.

This clearly isn't a "regression".  Would it nevertheless be OK to
install this fix in the Emacs 24 branch?

-- 
Alan Mackenzie (Nuremberg, Germany).



reply via email to

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