diff options
author | shyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-05-28 02:58:36 +0000 |
---|---|---|
committer | shyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-05-28 02:58:36 +0000 |
commit | b69e325cce8724ca52f120dad5f298feffaee6f9 (patch) | |
tree | baae0893eb46aa9d11eabc6cc690282bb00842b4 /array.c | |
parent | 9792f30e5701f6d18ff84f248e1f2b9d6ea02285 (diff) |
merge revision(s) 28048:
* array.c (rb_ary_product): Do not rely on GC, t0 should be
checked explicitly.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_2@28049 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'array.c')
-rw-r--r-- | array.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -4345,10 +4345,14 @@ rb_ary_product(int argc, VALUE *argv, VALUE ary) /* put it on the result array */ if(NIL_P(result)) { + FL_SET(t0, FL_USER5); rb_yield(subarray); - if (RBASIC(t0)->klass) { + if (! FL_TEST(t0, FL_USER5)) { rb_raise(rb_eRuntimeError, "product reentered"); } + else { + FL_UNSET(t0, FL_USER5); + } } else { rb_ary_push(result, subarray); |