Bug #8703

hash_type is not duplicated if hash is empty

Added by Masaki Matsushita over 1 year ago. Updated about 1 year ago.

[ruby-core:56256]
Status:Closed
Priority:Normal
Assignee:-
ruby -v:ruby 2.1.0dev (2013-07-29 trunk 42224) [x86_64-linux] Backport:1.9.3: DONTNEED, 2.0.0: DONE

Description

{}.compare_by_identity.dup.compare_by_identity? #=> false
{1=>1}.compare_by_identity.dup.compare_by_identity? #=> true

I think it is a bug.

patch.diff Magnifier (449 Bytes) Masaki Matsushita, 07/29/2013 04:30 PM

Associated revisions

Revision 42227
Added by Nobuyoshi Nakada over 1 year ago

hash.c: copied identhash

  • hash.c (rb_hash_initialize_copy): copy st_table type even if empty. [Bug #8703]

Revision 42227
Added by Nobuyoshi Nakada over 1 year ago

hash.c: copied identhash

  • hash.c (rb_hash_initialize_copy): copy st_table type even if empty. [Bug #8703]

Revision 42229
Added by Nobuyoshi Nakada over 1 year ago

hash.c: copied identhash

  • hash.c (rb_hash_initialize_copy): copy st_table type even if empty. [Bug #8703]

Revision 42229
Added by Nobuyoshi Nakada over 1 year ago

hash.c: copied identhash

  • hash.c (rb_hash_initialize_copy): copy st_table type even if empty. [Bug #8703]

History

#1 Updated by Nobuyoshi Nakada over 1 year ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

This issue was solved with changeset r42227.
Masaki, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


hash.c: copied identhash

  • hash.c (rb_hash_initialize_copy): copy st_table type even if empty. [Bug #8703]

#2 Updated by Usaku NAKAMURA about 1 year ago

  • Backport changed from 1.9.3: REQUIRED, 2.0.0: REQUIRED to 1.9.3: DONTNEED, 2.0.0: REQUIRED

#3 Updated by Tomoyuki Chikanaga about 1 year ago

  • Backport changed from 1.9.3: DONTNEED, 2.0.0: REQUIRED to 1.9.3: DONTNEED, 2.0.0: DONE

r42224, r42225, r42226, r42227, r42228, r42229 and r42232 were backported to ruby_2_0_0 at 44979.

Also available in: Atom PDF