[ruby-dev:24299] Re: [ruby-cvs] ruby/lib, ruby: * array.c (rb_ary_uniq_bang): element size might change during

From: Tanaka Akira <akr@...17n.org>
Date: 2004-09-21 10:00:47 UTC
List: ruby-dev #24299
In article <20040921093535.EBA94C696D@lithium.ruby-lang.org>,
  matz@ruby-lang.org (matz) writes:

> matz        Tue, 21 Sep 2004 18:35:30 +0900
>
>   Modified files:        (Branch: ruby_1_8)
>     ruby/lib:
>       delegate.rb
>     ruby:
>       util.h util.c hash.c enum.c dir.c array.c ChangeLog
>   Log:

>     * array.c (rb_ary_equal): wrong fix. [ruby-dev:24286]

直っていないように思います。

% ./ruby -ve 'p [] == [0]'
ruby 1.8.2 (2004-09-17) [i686-linux]
true

あと、

>   1.137.2.11  +64  -32   ruby/array.c
>     http://www.ruby-lang.org/cgi-bin/cvsweb.cgi/ruby/array.c?cvsroot=src&r1=1.137.2.10&r2=1.137.2.11

@@ -857,6 +864,10 @@ rb_ary_index(ary, val)
  *     array.rindex(obj)    ->  int or nil
  *  
  *  Returns the index of the last object in <i>array</i> 
+	if (i > RARRAY(ary)->len) {
+	    i = RARRAY(ary)->len;
+	    continue;
+	}
  *  <code>==</code> to <i>obj</i>. Returns <code>nil</code> if
  *  no match is found.
  *     

という hunk はなんかの (おそらく merge の) まちがいなんではないかと思います。
-- 
[田中 哲][たなか あきら][Tanaka Akira]

In This Thread

Prev Next