[macruby-changes] [1557] MacRuby/branches/experimental

source_changes at macosforge.org source_changes at macosforge.org
Fri May 8 04:50:31 PDT 2009


Revision: 1557
          http://trac.macosforge.org/projects/ruby/changeset/1557
Author:   vincent.isambart at gmail.com
Date:     2009-05-08 04:50:31 -0700 (Fri, 08 May 2009)
Log Message:
-----------
fixed a bug when using negative indexes in an array ary[-1]

Modified Paths:
--------------
    MacRuby/branches/experimental/roxor.cpp

Added Paths:
-----------
    MacRuby/branches/experimental/test_vm/array.rb

Modified: MacRuby/branches/experimental/roxor.cpp
===================================================================
--- MacRuby/branches/experimental/roxor.cpp	2009-05-08 02:37:14 UTC (rev 1556)
+++ MacRuby/branches/experimental/roxor.cpp	2009-05-08 11:50:31 UTC (rev 1557)
@@ -7929,7 +7929,7 @@
     // TODO what about T_HASH?
     if (overriden == 0 && TYPE(obj) == T_ARRAY) {
 	if (TYPE(other) == T_FIXNUM) {
-	    return rb_ary_elt(obj, FIX2INT(other));
+	    return rb_ary_entry(obj, FIX2INT(other));
 	}
 	extern VALUE rb_ary_aref(VALUE ary, SEL sel, int argc, VALUE *argv);
 	return rb_ary_aref(obj, 0, 1, &other);

Added: MacRuby/branches/experimental/test_vm/array.rb
===================================================================
--- MacRuby/branches/experimental/test_vm/array.rb	                        (rev 0)
+++ MacRuby/branches/experimental/test_vm/array.rb	2009-05-08 11:50:31 UTC (rev 1557)
@@ -0,0 +1 @@
+assert ':ok', 'a = [:ok]; p a[-1]'
\ No newline at end of file
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20090508/62680fca/attachment.html>


More information about the macruby-changes mailing list