summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-10-09 01:51:08 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-10-09 01:51:08 +0000
commit0922175659c8b9fbe5e566f4fe22333bf6087eb4 (patch)
treef31b9de1ff6a1130a77a8953e4c1311179540022
parent87cfa5ce86b2f21e291e9b4a459a376f64ec5986 (diff)
downloadruby-0922175659c8b9fbe5e566f4fe22333bf6087eb4.tar.gz
ruby-0922175659c8b9fbe5e566f4fe22333bf6087eb4.tar.xz
ruby-0922175659c8b9fbe5e566f4fe22333bf6087eb4.zip
* eval.c (rb_yield_0): no error if block is empty.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@4727 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog4
-rw-r--r--eval.c5
2 files changed, 8 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 20f8c2176..abaacb814 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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.
diff --git a/eval.c b/eval.c
index 3e4f691b5..9d3ce0867 100644
--- a/eval.c
+++ b/eval.c
@@ -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);