summaryrefslogtreecommitdiff
path: root/array.c
diff options
context:
space:
mode:
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);