diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2006-06-24 14:52:59 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2006-06-24 14:52:59 +0000 |
commit | bb87f28346746d02aa7cb9ea7d49d03a3d8452ef (patch) | |
tree | 1737ebcf043cfd5e7cd2adb1f0b181b25f4ba24a /array.c | |
parent | b72f065343d876c6ea59cc7c883b8ee01b4e7506 (diff) | |
download | ruby-bb87f28346746d02aa7cb9ea7d49d03a3d8452ef.tar.gz |
* eval.c (rb_eval): use rb_ary_new2 instead of rb_ary_new4 to avoid
GC problem.
(rb_yield_values): use rb_ary_new2 instead of rb_ary_new4.
* array.c (rb_ary_new4): don't set len as n. make it safe with GC.
[ruby-dev:28826]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10377 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'array.c')
-rw-r--r-- | array.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -163,8 +163,8 @@ rb_ary_new4(long n, const VALUE *elts) ary = rb_ary_new2(n); if (n > 0 && elts) { MEMCPY(RARRAY(ary)->ptr, elts, VALUE, n); + RARRAY(ary)->len = n; } - RARRAY(ary)->len = n; return ary; } |