Actions
Bug #13003
closedAbout not Random instance of random: keyword ardument of Array#shuffle!
    Bug #13003:
    About not Random instance of random: keyword ardument of Array#shuffle! 
  
Description
Array#shuffle! の random: キーワード引数で、Randomのインスタンスでないような
任意のオブジェクトを渡してしまっていても、(最終的に)rb_random_ulong_limited 中の
rb_funcallv(obj, id_rand, 1, &lim) という呼び出しによりグローバルの rand が
呼び出されて、それっぽく動いてしまいます。
わざわざ random: キーワード引数で渡していながら、変なオブジェクトを渡してしまって
いる、というのは、ユーザのスクリプトのバグである可能性が高いと思うのですが、
それでもそれっぽく動いてしまうようになっている、というのは、そのように意図されて
いるものでしょうか?
        
           Updated by aamine (Minero Aoki) over 8 years ago
          Updated by aamine (Minero Aoki) over 8 years ago
          
          
        
        
      
      - Status changed from Open to Closed
This bug is already fixed, close.
        
           Updated by nobu (Nobuyoshi Nakada) over 8 years ago
          Updated by nobu (Nobuyoshi Nakada) over 8 years ago
          
          
        
        
      
      - Tracker changed from Misc to Bug
- Backport set to 2.2: REQUIRED, 2.3: REQUIRED, 2.4: REQUIRED
        
           Updated by nobu (Nobuyoshi Nakada) over 8 years ago
          Updated by nobu (Nobuyoshi Nakada) over 8 years ago
          
          
        
        
      
      - Backport changed from 2.2: REQUIRED, 2.3: REQUIRED, 2.4: REQUIRED to 2.2: REQUIRED, 2.3: REQUIRED, 2.4: DONTNEED
Actions