summaryrefslogtreecommitdiffstats
path: root/array.c
diff options
context:
space:
mode:
authoryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-01-28 09:23:30 +0000
committeryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-01-28 09:23:30 +0000
commit619c47b9cfde4ea60e86933092b2ce4af18bf33c (patch)
tree8668963c73c6f2be0b1fb6a3b58bac745b664fed /array.c
parent2fa9bcd392be2c0ce72ee7f401860bba615b31cc (diff)
merges r21780 from trunk into ruby_1_9_1.
* array.c (rb_ary_aset): fixed arguments evaluation order. git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_9_1@21836 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'array.c')
-rw-r--r--array.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/array.c b/array.c
index 3994ce6e0..fb92c0f0b 100644
--- a/array.c
+++ b/array.c
@@ -1264,7 +1264,9 @@ rb_ary_aset(int argc, VALUE *argv, VALUE ary)
long offset, beg, len;
if (argc == 3) {
- rb_ary_splice(ary, NUM2LONG(argv[0]), NUM2LONG(argv[1]), argv[2]);
+ beg = NUM2LONG(argv[0]);
+ len = NUM2LONG(argv[1]);
+ rb_ary_splice(ary, beg, len, argv[2]);
return argv[2];
}
if (argc != 2) {