unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Paul Eggert <eggert@cs.ucla.edu>
To: Eli Zaretskii <eliz@gnu.org>
Cc: Lars Ingebrigtsen <larsi@gnus.org>, 14412@debbugs.gnu.org
Subject: bug#14412: 24.3.50; emacs_backtrace.txt
Date: Sat, 26 Dec 2015 09:43:25 -0800	[thread overview]
Message-ID: <567ED1BD.2040702@cs.ucla.edu> (raw)
In-Reply-To: <8C813F37B4B14362BEDAE9C4BCC38589@us.oracle.com>

[-- Attachment #1: Type: text/plain, Size: 291 bytes --]

Eli, thanks for fixing that. There's parallel code in backtrace_eval_unrewind 
that presumably should be fixed in a similar way. Also, it's clearer to keep the 
FALLTHROUGH!! comment at the actual fallthrough point. I installed the attached 
additional patch to try to address these issues.

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Propagate-Bug-14412-fix-to-backtrace_eval_unrewind.patch --]
[-- Type: text/x-diff; name="0001-Propagate-Bug-14412-fix-to-backtrace_eval_unrewind.patch", Size: 2310 bytes --]

From 60764d06b76ce39c2c902c302c29954945ed0e9c Mon Sep 17 00:00:00 2001
From: Paul Eggert <eggert@cs.ucla.edu>
Date: Sat, 26 Dec 2015 09:30:22 -0800
Subject: [PATCH] Propagate Bug#14412 fix to backtrace_eval_unrewind
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

* src/eval.c (unbind_to): Redo so that the FALLTHROUGH!! comment
becomes accurate again. This shouldn’t affect behavior.
(backtrace_eval_unrewind): Apply the recent unbind_to fix here, too.
---
 src/eval.c | 21 +++++++++------------
 1 file changed, 9 insertions(+), 12 deletions(-)

diff --git a/src/eval.c b/src/eval.c
index 571681c..bd0cf68 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -3196,15 +3196,12 @@ unbind_to (ptrdiff_t count, Lisp_Object value)
 	  { /* If variable has a trivial value (no forwarding), we can
 	       just set it.  No need to check for constant symbols here,
 	       since that was already done by specbind.  */
-	    Lisp_Object symbol = specpdl_symbol (specpdl_ptr);
-	    if (SYMBOLP (symbol))
+	    Lisp_Object sym = specpdl_symbol (specpdl_ptr);
+	    if (SYMBOLP (sym) && XSYMBOL (sym)->redirect == SYMBOL_PLAINVAL)
 	      {
-		struct Lisp_Symbol *sym = XSYMBOL (symbol);
-		if (sym->redirect == SYMBOL_PLAINVAL)
-		  {
-		    SET_SYMBOL_VAL (sym, specpdl_old_value (specpdl_ptr));
-		    break;
-		  }
+		SET_SYMBOL_VAL (XSYMBOL (sym),
+				specpdl_old_value (specpdl_ptr));
+		break;
 	      }
 	    else
 	      { /* FALLTHROUGH!!
@@ -3412,12 +3409,12 @@ backtrace_eval_unrewind (int distance)
 	  { /* If variable has a trivial value (no forwarding), we can
 	       just set it.  No need to check for constant symbols here,
 	       since that was already done by specbind.  */
-	    struct Lisp_Symbol *sym = XSYMBOL (specpdl_symbol (tmp));
-	    if (sym->redirect == SYMBOL_PLAINVAL)
+	    Lisp_Object sym = specpdl_symbol (tmp);
+	    if (SYMBOLP (sym) && XSYMBOL (sym)->redirect == SYMBOL_PLAINVAL)
 	      {
 		Lisp_Object old_value = specpdl_old_value (tmp);
-		set_specpdl_old_value (tmp, SYMBOL_VAL (sym));
-		SET_SYMBOL_VAL (sym, old_value);
+		set_specpdl_old_value (tmp, SYMBOL_VAL (XSYMBOL (sym)));
+		SET_SYMBOL_VAL (XSYMBOL (sym), old_value);
 		break;
 	      }
 	    else
-- 
2.5.0


      parent reply	other threads:[~2015-12-26 17:43 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-16 21:21 bug#14412: 24.3.50; emacs_backtrace.txt Drew Adams
2013-05-17  9:59 ` Eli Zaretskii
2015-12-26  0:47   ` Lars Ingebrigtsen
2015-12-26 10:07     ` Eli Zaretskii
2015-12-26 10:44       ` Eli Zaretskii
2015-12-26 17:43 ` Paul Eggert [this message]

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=567ED1BD.2040702@cs.ucla.edu \
    --to=eggert@cs.ucla.edu \
    --cc=14412@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=larsi@gnus.org \
    /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).