diff options
author | shyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-05-28 02:43:34 +0000 |
---|---|---|
committer | shyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-05-28 02:43:34 +0000 |
commit | 97b1c9edd2993d08370e89e4977e00cb25778cbd (patch) | |
tree | e57877b1b4bd7b0974944bc97eaa440dd435605a /array.c | |
parent | 66c8f4680f171b010c298b5cf99b19e5693c1795 (diff) | |
download | ruby-97b1c9edd2993d08370e89e4977e00cb25778cbd.tar.gz |
* 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/trunk@28048 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); |