GNU bug report logs - #16585
c-invalidate-state-cache fails if called when narrowed

Previous Next

Packages: cc-mode, emacs;

Reported by: Daniel Colascione <dancol <at> dancol.org>

Date: Wed, 29 Jan 2014 02:10:01 UTC

Severity: normal

Done: Daniel Colascione <dancol <at> dancol.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Alan Mackenzie <acm <at> muc.de>
To: Daniel Colascione <dancol <at> dancol.org>
Cc: 16585 <at> debbugs.gnu.org, rgm <at> gnu.org
Subject: bug#16585: c-invalidate-state-cache fails if called when narrowed
Date: Wed, 5 Feb 2014 23:16:07 +0000
Hi, Daniel.

On Tue, Jan 28, 2014 at 06:09:04PM -0800, Daniel Colascione wrote:
> c-invalidate-state-cache can fail if called in a narrowed region: we end 
> up calling c-clear-char-property for bob even if that's before 
> point-min, causing remote-text-properties to raise (args-out-of-range 1 2).

> We get into this situation when expanding yasnippet snippets; we're 
> calling c-invalidate-state-cache from c-before-change.

> To repro manually, first write this to some buffer.

> #include <stdio.h>

> void foo() {

> }


> Then (this is important) run M-x c-mode. After starting the mode, move 
> point to inside foo's body and eval (save-restriction (narrow-to-region 
> (point-at-bol) (point-at-eol)) (c-invalidate-state-cache (point))). You 
> should break into the debugger.

> The patch below seems correct and fixes the problem for me, but it'd be 
> nice if Alan could take a look at it before I push it to trunk. The 
> version of c-invalidate-state-cache in cc-mode trunk is very different.

I think I'd like to check that nothing can go awry in
c-invalidate-state-cache-1 with the widened buffer.  Give me a day or
two.

-- 
Alan Mackenzie (Nuremberg, Germany).




This bug report was last modified 11 years and 101 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.