unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Another bug in CC Mode's state cache.
@ 2012-04-20 20:04 Alan Mackenzie
  2012-04-20  6:19 ` Leo
  2012-04-21  2:30 ` Stefan Monnier
  0 siblings, 2 replies; 5+ messages in thread
From: Alan Mackenzie @ 2012-04-20 20:04 UTC (permalink / raw)
  To: Chong Yidong; +Cc: emacs-devel

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).



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-04-21  7:22 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-20 20:04 Another bug in CC Mode's state cache Alan Mackenzie
2012-04-20  6:19 ` Leo
2012-04-21  7:22   ` Alan Mackenzie
2012-04-21  2:30 ` Stefan Monnier
2012-04-21  7:19   ` Alan Mackenzie

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).