From: Damien Cassou <damien@cassou.me>
To: Jeff Norden <jnorden@tntech.edu>, 40317@debbugs.gnu.org
Cc: Alan Mackenzie <acm@muc.de>
Subject: bug#40317: 27.0.90; Reverting a buffer that visits C file signals an error
Date: Fri, 18 Sep 2020 21:46:03 +0200 [thread overview]
Message-ID: <87imcac1hg.fsf@cassou.me> (raw)
In-Reply-To: <fd7dsr3mms.fsf@norden.tntech.edu>
[-- Attachment #1: Type: text/plain, Size: 712 bytes --]
Hi Jeff,
Jeff Norden <jnorden@tntech.edu> writes:
> Unfortunately, I can't figure out how to trigger this bug myself. If you want
> to be 100% sure about it, you might try adding
>
> (if (> c-new-END (point-max))
> (error "c-new-END is too big! %d > %d" c-new-END (point-max)))
>
> right after line-2009 and see if it raises an error before it gets to
> parse-partial-sexp.
I wasn't sure if you wanted me to only add the `if` or if you wanted me
to also change the previous line. I've just added the `if` with the
attached patch and will report if I get the new error message.
--
Damien Cassou
"Success is the ability to go from one failure to another without
losing enthusiasm." --Winston Churchill
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: emacs-bug-40317.patch --]
[-- Type: text/x-diff, Size: 528 bytes --]
--- a/lisp/progmodes/cc-mode.el.orig 2020-07-29 23:40:41.000000000 +0200
+++ b/lisp/progmodes/cc-mode.el 2020-09-18 15:36:37.409779350 +0200
@@ -2007,6 +2007,10 @@
;; larger than (beg end).
(setq c-new-END (- (+ c-new-END (- end beg)) old-len))
+ ;; Trying to fix bug#40317
+ (if (> c-new-END (point-max))
+ (error "c-new-END is too big! %d > %d" c-new-END (point-max)))
+
(unless (c-called-from-text-property-change-p)
(setq c-just-done-before-change nil)
(c-save-buffer-state (case-fold-search)
next prev parent reply other threads:[~2020-09-18 19:46 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-29 13:26 bug#40317: 27.0.90; Reverting a buffer that visits C file signals an error Eli Zaretskii
2020-09-16 12:24 ` Damien Cassou
2020-09-16 14:26 ` Eli Zaretskii
2020-09-16 14:51 ` Damien Cassou
2020-09-16 15:09 ` Eli Zaretskii
2020-09-16 18:19 ` Damien Cassou
2020-09-18 1:21 ` Jeff Norden
2020-09-18 19:46 ` Damien Cassou [this message]
2020-09-18 20:13 ` Alan Mackenzie
2020-09-18 22:03 ` Jeff Norden
2020-09-19 7:35 ` Eli Zaretskii
2020-09-19 11:48 ` Alan Mackenzie
2020-09-20 17:25 ` Alan Mackenzie
2020-10-29 14:19 ` Damien Cassou
2022-02-20 15:11 ` Lars Ingebrigtsen
2022-02-21 10:09 ` Damien Cassou
2022-02-21 14:08 ` Lars Ingebrigtsen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87imcac1hg.fsf@cassou.me \
--to=damien@cassou.me \
--cc=40317@debbugs.gnu.org \
--cc=acm@muc.de \
--cc=jnorden@tntech.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).