summaryrefslogtreecommitdiff
path: root/array.c
diff options
context:
space:
mode:
authorshyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-05-28 02:43:34 +0000
committershyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-05-28 02:43:34 +0000
commit97b1c9edd2993d08370e89e4977e00cb25778cbd (patch)
treee57877b1b4bd7b0974944bc97eaa440dd435605a /array.c
parent66c8f4680f171b010c298b5cf99b19e5693c1795 (diff)
* 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.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/array.c b/array.c
index 280f45bba1..146b03b137 100644
--- a/array.c
+++ b/array.c
@@ -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);