GNU bug report logs - #7181
24.0.50; args-out-of-range while reverting C++ header file

Previous Next

Packages: emacs, cc-mode;

Reported by: ofv <at> wanadoo.es (Oscar Fuentes)

Date: Sat, 9 Oct 2010 04:28:01 UTC

Severity: normal

Found in version 24.0.50

Done: Glenn Morris <rgm <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #26 received at 7181 <at> debbugs.gnu.org (full text, mbox):

From: Alan Mackenzie <acm <at> muc.de>
To: Óscar Fuentes <ofv <at> wanadoo.es>
Cc: 7181 <at> debbugs.gnu.org
Subject: Re: bug#7181: 24.0.50;
	args-out-of-range while reverting C++ header file.  PATCH.
Date: Sun, 10 Oct 2010 14:09:58 +0000
Hi, Óscar,

On Sat, Oct 09, 2010 at 03:56:39PM +0200, Óscar Fuentes wrote:
> With the attached files the problem can be reproduced predictability:
> 
> Save the attached files b.h.master and b.h.next to a directory and cd to
> it.
> 
> $ emacs -Q &
> $ cp b.h.master b.h
> C-x C-f b.h
> $ cp b.h.next b.h
> M-x revert-buffer
> 
> and the args-out-of-range error pops:
> 
> c-clear-char-property-with-value-function: Args out of range: 166, 453
> 
> I was unable to try with the latest Emacs sources because the build is
> broken. My Emacs is from the 16 September.
> 

Please try the following patch and confirm that it works.  I'll get it
committed just as soon as I manage to connect to the new server:




*** cc-mode.el.~3~	2010-10-08 20:27:13.000000000 +0000
--- cc-mode.el	2010-10-10 13:46:28.074200752 +0000
***************
*** 1029,1038 ****
  			    (buffer-substring-no-properties type-pos term-pos)
  			    (buffer-substring-no-properties beg end)))))))
  
- 	;; (c-new-BEG c-new-END) will be the region to fontify.  It may become
- 	;; larger than (beg end).
- 	(setq c-new-BEG beg
- 	      c-new-END end)
  	(if c-get-state-before-change-functions
  	    (mapc (lambda (fn)
  		    (funcall fn beg end))
--- 1029,1034 ----
***************
*** 1086,1091 ****
--- 1082,1091 ----
  	(when c-recognize-<>-arglists
  	  (c-after-change-check-<>-operators beg end))
  
+ 	;; (c-new-BEG c-new-END) will be the region to fontify.  It may become
+ 	;; larger than (beg end).
+ 	(setq c-new-BEG beg
+ 	      c-new-END end)
  	(if c-before-font-lock-function
  	    (save-excursion
  	      (funcall c-before-font-lock-function beg end old-len)))))))

      

-- 
Alan Mackenzie (Nuremberg, Germany).




This bug report was last modified 14 years and 276 days ago.

Previous Next


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