GNU bug report logs - #26639
26.0.50; sxhash gives non-equal values for equal records

Previous Next

Package: emacs;

Reported by: Damien Cassou <damien <at> cassou.me>

Date: Mon, 24 Apr 2017 14:51:01 UTC

Severity: normal

Tags: confirmed

Merged with 27057

Found in version 26.0.50

Done: Stefan Monnier <monnier <at> iro.umontreal.ca>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Subject: bug#27057: closed (Re: bug#27057: 26.0.50; Equal defstruct
 objects not recognized in puthash)
Date: Wed, 24 May 2017 15:57:03 +0000
[Message part 1 (text/plain, inline)]
Your bug report

#26639: 26.0.50; Equal defstruct objects not recognized in puthash

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to 27057 <at> debbugs.gnu.org.

-- 
26639: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=26639
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: 27057-done <at> debbugs.gnu.org, 26639-done <at> debbugs.gnu.org
Cc: Lars Brinkhoff <lars <at> nocrew.org>, Michael Albinus <Michael.Albinus <at> gmx.de>
Subject: Re: bug#27057: 26.0.50;
 Equal defstruct objects not recognized in puthash
Date: Wed, 24 May 2017 11:56:25 -0400
>     (progn
>       (cl-defstruct sm-foo a b)
>       (setq sm-hash (make-hash-table :test 'equal))
>       (puthash (make-sm-foo :a 4 :b 6) "test1" sm-hash)
>       (puthash (make-sm-foo :a 4 :b 6) "test2" sm-hash)
>       (hash-table-count sm-hash))
>
> this code return 2 here instead of 1.

This should be fixed now,


        Stefan

[Message part 3 (message/rfc822, inline)]
From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: bug-gnu-emacs <at> gnu.org
Subject: 26.0.50; Equal defstruct objects not recognized in puthash
Date: Wed, 24 May 2017 11:39:56 -0400
Package: Emacs
Version: 26.0.50

It looks like the new records-based code introduced a bug in the way
records are handled as keys in hash-tables when the test is `equal`:

    (progn
      (cl-defstruct sm-foo a b)
      (setq sm-hash (make-hash-table :test 'equal))
      (puthash (make-sm-foo :a 4 :b 6) "test1" sm-hash)
      (puthash (make-sm-foo :a 4 :b 6) "test2" sm-hash)
      (hash-table-count sm-hash))

this code return 2 here instead of 1.  Lars, could you take a look at it?


        Stefan



This bug report was last modified 7 years and 363 days ago.

Previous Next


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