diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2006-06-27 01:48:29 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2006-06-27 01:48:29 +0000 |
commit | 6bbafe7a93e96188ae2739b6961e8da285a0da64 (patch) | |
tree | 6a964494f7cd04449fa0f3451d8055c34a9e87d2 | |
parent | 2204c27415bec35f05cd2f5913e804d058c40de3 (diff) | |
download | ruby-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-- | ChangeLog | 4 | ||||
-rw-r--r-- | eval.c | 5 |
2 files changed, 8 insertions, 1 deletions
@@ -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. @@ -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); } |