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 | |
| 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
| -rw-r--r-- | ChangeLog | 5 | ||||
| -rw-r--r-- | array.c | 6 |
2 files changed, 10 insertions, 1 deletions
@@ -1,3 +1,8 @@ +Fri May 28 11:58:42 2010 URABE Shyouhei <shyouhei@ruby-lang.org> + + * array.c (rb_ary_product): Do not rely on GC, t0 should be + checked explicitly. + Fri May 28 10:40:37 2010 Nobuyoshi Nakada <nobu@ruby-lang.org> * lib/mkmf.rb (checking_for): ignore toplevel. @@ -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); |
