Bug #7466

Hashの大きさによってHash#keysでvalueが返ることがある

Added by Shin-ichiro OGAWA over 1 year ago. Updated over 1 year ago.

[ruby-dev:46658]
Status:Closed
Priority:Normal
Assignee:-
Category:-
Target version:-
ruby -v:ruby 2.0.0dev (2012-11-29 trunk 37974) [x86_64-linux] Backport:

Description

=begin
jpmobileのRuby 2.0対応をやっていてわかったのですが、添付のようなHashでkeysの戻り値が途中でvalueになってしまい、それ以降valueが返るようになります。

% ruby -v
ruby 2.0.0dev (2012-11-29 trunk 37974) [x86_64-linux]
% ruby google.rb
[1040450,
(snip)
 1041201,
 "",
 60101,
 60288]

Ruby 2.0 は rbenv install 2.0.0-dev でインストールしました。
=end

google.rb Magnifier (2.77 KB) Shin-ichiro OGAWA, 11/29/2012 04:31 PM

Associated revisions

Revision 37991
Added by Nobuyoshi Nakada over 1 year ago

compile.c: hash must be paired

  • compile.c (compilearray): hash elements must be paired even for literal elements. [Bug #7466]

Revision 38000
Added by Yui NARUSE over 1 year ago

  • compile.c (compilearray): refix r37991 remove assertion:
    it is true only if type == COMPILEARRAYTYPE_HASH.
    [Bug #7466]

  • vm.c (mcorehashfromary): add assertion instead of above.

  • vm.c (mcorehashmergeary): ditto.

History

#1 Updated by Shin-ichiro OGAWA over 1 year ago

#2 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 r37991.
Shin-ichiro, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


compile.c: hash must be paired

  • compile.c (compilearray): hash elements must be paired even for literal elements. [Bug #7466]

#3 Updated by Yui NARUSE over 1 year ago

  • Status changed from Closed to Assigned

#4 Updated by Yui NARUSE over 1 year ago

  • Status changed from Assigned to Closed

This issue was solved with changeset r38000.
Shin-ichiro, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


  • compile.c (compilearray): refix r37991 remove assertion:
    it is true only if type == COMPILEARRAYTYPE_HASH.
    [Bug #7466]

  • vm.c (mcorehashfromary): add assertion instead of above.

  • vm.c (mcorehashmergeary): ditto.

Also available in: Atom PDF