diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-10-09 01:51:08 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-10-09 01:51:08 +0000 |
commit | 894d8d9e618d352a1a54f19210f6e1d99d18cdd8 (patch) | |
tree | f31b9de1ff6a1130a77a8953e4c1311179540022 | |
parent | 99e2ecdebf9c60c8d62cf591c637fb061f2365d5 (diff) |
* eval.c (rb_yield_0): no error if block is empty.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4727 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | eval.c | 5 |
2 files changed, 8 insertions, 1 deletions
@@ -1,3 +1,7 @@ +Thu Oct 9 10:51:04 2003 Nobuyoshi Nakada <nobu@ruby-lang.org> + + * eval.c (rb_yield_0): no error if block is empty. + Thu Oct 9 06:43:33 2003 Nobuyoshi Nakada <nobu@ruby-lang.org> * eval.c (localjump_error): id should be ID. @@ -4162,7 +4162,10 @@ rb_yield_0(val, self, klass, flags, avalue) POP_TAG(); if (state) goto pop_state; } - if (!node) goto pop_state; + if (!node) { + state = 0; + goto pop_state; + } PUSH_ITER(block->iter); PUSH_TAG(PROT_NONE); |