summaryrefslogtreecommitdiffstats
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
commit6bbafe7a93e96188ae2739b6961e8da285a0da64 (patch)
tree6a964494f7cd04449fa0f3451d8055c34a9e87d2
parent2204c27415bec35f05cd2f5913e804d058c40de3 (diff)
downloadruby-6bbafe7a93e96188ae2739b6961e8da285a0da64.tar.gz
ruby-6bbafe7a93e96188ae2739b6961e8da285a0da64.tar.xz
ruby-6bbafe7a93e96188ae2739b6961e8da285a0da64.zip
* eval.c (rb_yield_0): avoid core dump. [ruby-dev:28840]
git-svn-id: http://svn.ruby-lang.org/repos/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 5ebf0b308..4d9fc6d54 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 ec1beb3ac..cca4c44c6 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);
}