GNU bug report logs -
#65051
internal_equal manipulates symbols with position without checking symbols-with-pos-enabled.
Previous Next
Reported by: Alan Mackenzie <acm <at> muc.de>
Date: Fri, 4 Aug 2023 14:01:02 UTC
Severity: normal
Done: Alan Mackenzie <acm <at> muc.de>
Bug is archived. No further changes may be made.
Full log
Message #8 received at 65051 <at> debbugs.gnu.org (full text, mbox):
> Date: Fri, 4 Aug 2023 14:00:29 +0000
> From: Alan Mackenzie <acm <at> muc.de>
>
> Hello, Emacs.
>
> The code in question is in internal_equal (src/fns.c) ~37 lines from its
> start. We have:
>
> if (SYMBOL_WITH_POS_P (o1))
> o1 = SYMBOL_WITH_POS_SYM (o1);
> if (SYMBOL_WITH_POS_P (o2))
> o2 = SYMBOL_WITH_POS_SYM (o2);
>
> at the top level of the function. Thus
>
> (equal 'foo #<symbol foo at 42>)
>
> will return non-nil, regardless of the setting of
> symbols-with-pos-enabled. It should return non-nil only when that flag
> variable is non-nil. This is a bug.
>
> #########################################################################
>
> A simple fix is:
What will happen to the comparison in internal_equal when
symbols_with_pos_enabled is zero and the two objects have different
positions, or one has a position, the other doesn't?
And which branch are you proposing this change for?
This bug report was last modified 1 year and 315 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.