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.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 6744 in the body.
You can then email your comments to 6744 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#6744; Package emacs. (Wed, 28 Jul 2010 00:16:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to "Johan Bockg\=e5rd" <bojohan <at> gnu.org>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Wed, 28 Jul 2010 00:16:02 GMT) Full text and rfc822 format available.

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))
 	  {





Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#6744; Package emacs. (Wed, 28 Jul 2010 00:58:02 GMT) Full text and rfc822 format available.

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

From: Juanma Barranquero <lekktu <at> gmail.com>
To: "Johan Bockg=e5rd" <bojohan <at> gnu.org>
Cc: 6744 <at> debbugs.gnu.org
Subject: Re: bug#6744: 24.0.50; [PATCH] local-variable-p: Handle variable 
	aliases correctly
Date: Wed, 28 Jul 2010 02:57:14 +0200
On Wed, Jul 28, 2010 at 02:15, Johan Bockg=e5rd <bojohan <at> gnu.org> wrote:

>    (defvar foo nil)
>    (defvaralias 'bar 'foo)
>    (make-local-variable 'bar)
>    (local-variable-p 'bar)
>
> returns nil or may crash if checking is enabled. (trunk)

On the trunk, setting the forms inside a progn and evaluating it at
once with C-x C-e, I get nil on first try, and a crash on second try.

On emacs-23 there's no crash, but (local-variable-p 'bar) => nil.

> +       XSETSYMBOL (variable, sym); /* Update in case of aliasing.  */

Does this fix work also for emacs-23?

    Juanma




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#6744; Package emacs. (Wed, 28 Jul 2010 03:21:01 GMT) Full text and rfc822 format available.

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

From: Johan Bockgård <bojohan <at> gnu.org>
To: Juanma Barranquero <lekktu <at> gmail.com>
Cc: 6744 <at> debbugs.gnu.org
Subject: Re: bug#6744: 24.0.50;
	[PATCH] local-variable-p: Handle variable  aliases correctly
Date: Wed, 28 Jul 2010 05:20:45 +0200
Juanma Barranquero <lekktu <at> gmail.com> writes:

> On Wed, Jul 28, 2010 at 02:15, Johan Bockg=e5rd <bojohan <at> gnu.org> wrote:
>
>>    (defvar foo nil)
>>    (defvaralias 'bar 'foo)
>>    (make-local-variable 'bar)
>>    (local-variable-p 'bar)
>>
>> returns nil or may crash if checking is enabled. (trunk)
>
> On the trunk, setting the forms inside a progn and evaluating it at
> once with C-x C-e, I get nil on first try, and a crash on second try.
>
> On emacs-23 there's no crash, but (local-variable-p 'bar) => nil.

It is? I thought this problem only existed in the trunk, and I can't
reproduce it in the emacs-23 branch.




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#6744; Package emacs. (Wed, 28 Jul 2010 03:35:02 GMT) Full text and rfc822 format available.

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

From: Juanma Barranquero <lekktu <at> gmail.com>
To: Johan Bockgård <bojohan <at> gnu.org>
Cc: 6744 <at> debbugs.gnu.org
Subject: Re: bug#6744: 24.0.50; [PATCH] local-variable-p: Handle variable 
	aliases correctly
Date: Wed, 28 Jul 2010 05:33:59 +0200
On Wed, Jul 28, 2010 at 05:20, Johan Bockgård <bojohan <at> gnu.org> wrote:

> It is? I thought this problem only existed in the trunk, and I can't
> reproduce it in the emacs-23 branch.

You're right, it returns t. Sorry for the noise.

    Juanma




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#6744; Package emacs. (Sun, 01 Aug 2010 18:36:02 GMT) Full text and rfc822 format available.

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

From: Juanma Barranquero <lekktu <at> gmail.com>
To: "Johan Bockg=e5rd" <bojohan <at> gnu.org>
Cc: 6744 <at> debbugs.gnu.org
Subject: Re: bug#6744: 24.0.50; [PATCH] local-variable-p: Handle variable 
	aliases correctly
Date: Sun, 1 Aug 2010 20:35:07 +0200
On Wed, Jul 28, 2010 at 02:15, Johan Bockg=e5rd <bojohan <at> gnu.org> wrote:

> 2010-07-27  Johan Bockg=e5rd  <bojohan <at> gnu.org>
>
>        * data.c (Flocal_variable_p): Handle variable aliases correctly.
>
> +       XSETSYMBOL (variable, sym); /* Update in case of aliasing.  */

If you think this is the right fix, please install it.

    Juanma




Reply sent to Johan Bockgård <bojohan <at> gnu.org>:
You have taken responsibility. (Tue, 03 Aug 2010 17:14:02 GMT) Full text and rfc822 format available.

Notification sent to "Johan Bockg\=e5rd" <bojohan <at> gnu.org>:
bug acknowledged by developer. (Tue, 03 Aug 2010 17:14:02 GMT) Full text and rfc822 format available.

Message #22 received at 6744-done <at> debbugs.gnu.org (full text, mbox):

From: Johan Bockgård <bojohan <at> gnu.org>
To: Juanma Barranquero <lekktu <at> gmail.com>
Cc: 6744-done <at> debbugs.gnu.org
Subject: Re: bug#6744: 24.0.50;
	[PATCH] local-variable-p: Handle variable  aliases correctly
Date: Tue, 03 Aug 2010 19:13:49 +0200
Juanma Barranquero <lekktu <at> gmail.com> writes:

> On Wed, Jul 28, 2010 at 02:15, Johan Bockg=e5rd <bojohan <at> gnu.org> wrote:
>
>> 2010-07-27  Johan Bockg=e5rd  <bojohan <at> gnu.org>
>>
>>        * data.c (Flocal_variable_p): Handle variable aliases correctly.
>>
>> +       XSETSYMBOL (variable, sym); /* Update in case of aliasing.  */
>
> If you think this is the right fix, please install it.

Done.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 01 Sep 2010 11:24:04 GMT) Full text and rfc822 format available.

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.