summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-06-27 01:48:29 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-06-27 01:48:29 +0000
commit8ae45d642f086128e9f632cb8320d78bf5528735 (patch)
tree6a964494f7cd04449fa0f3451d8055c34a9e87d2
parent90952d32f80e3733e9895f296aea067a828d0143 (diff)
* eval.c (rb_yield_0): avoid core dump. [ruby-dev:28840]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10407 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 5ebf0b308a..4d9fc6d544 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Tue Jun 27 10:46:53 2006 Tanaka Akira <akr@m17n.org>
+
+ * eval.c (rb_yield_0): avoid core dump. [ruby-dev:28840]
+
Mon Jun 26 11:03:00 2006 Eric Hodel <drbrain@segment7.net>
* lib/rdoc/ri: Add options to limit the ri search path.
diff --git a/eval.c b/eval.c
index ec1beb3acd..cca4c44c61 100644
--- a/eval.c
+++ b/eval.c
@@ -4740,7 +4740,10 @@ rb_yield_0(VALUE val, VALUE self, VALUE klass /* OK */, int flags)
}
else {
if (pcall) {
- val = RARRAY(val)->ptr[0];
+ if (RARRAY(val)->len == 0)
+ val = Qnil;
+ else
+ val = RARRAY(val)->ptr[0];
}
assign(self, var, val, pcall);
}