GNU bug report logs - #6744
24.0.50; [PATCH] local-variable-p: Handle variable aliases correctly

Previous Next

Package: emacs;

Reported by: "Johan Bockg\=e5rd" <bojohan <at> gnu.org>

Date: Wed, 28 Jul 2010 00:16:02 UTC

Severity: normal

Tags: patch

Found in version 24.0.50

Done: Johan Bockgård <bojohan <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


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

From: "Johan Bockg\=e5rd" <bojohan <at> gnu.org>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.0.50; [PATCH] local-variable-p: Handle variable aliases correctly
Date: Wed, 28 Jul 2010 02:15:32 +0200
Found by --enable-checking.

    (defvar foo nil)
    (defvaralias 'bar 'foo)
    (make-local-variable 'bar)
    (local-variable-p 'bar)

returns nil or may crash if checking is enabled. (trunk)



2010-07-27  Johan Bockg=e5rd  <bojohan <at> gnu.org>

	* data.c (Flocal_variable_p): Handle variable aliases correctly.


diff --git a/src/data.c b/src/data.c
index 152a888..b78a665 100644
--- a/src/data.c
+++ b/src/data.c
@@ -1865,6 +1865,7 @@ BUFFER defaults to the current buffer.  */)
 	Lisp_Object tail, elt, tmp;
 	struct Lisp_Buffer_Local_Value *blv = SYMBOL_BLV (sym);
 	XSETBUFFER (tmp, buf);
+	XSETSYMBOL (variable, sym); /* Update in case of aliasing.  */
 
 	for (tail = buf->local_var_alist; CONSP (tail); tail = XCDR (tail))
 	  {





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

Previous Next


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