diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-11-28 00:26:27 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-11-28 00:26:27 +0000 |
commit | af886605cd1a1ed38162691667a15a50b30e2b99 (patch) | |
tree | fa5ccd76a1f9c43f841e377a6d4dc815fd8f5609 | |
parent | bdfa13ba9580e51caba0d93e610def712fa53dcc (diff) | |
download | ruby-af886605cd1a1ed38162691667a15a50b30e2b99.tar.gz ruby-af886605cd1a1ed38162691667a15a50b30e2b99.tar.xz ruby-af886605cd1a1ed38162691667a15a50b30e2b99.zip |
* vm_eval.c (check_funcall_failed): should rescue user raised
NoMethodError. rescue all NoMethodError if receiver does not
respond to the method name. [ruby-dev:39796]
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25954 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | vm_eval.c | 5 |
2 files changed, 8 insertions, 3 deletions
@@ -1,3 +1,9 @@ +Sat Nov 28 09:05:53 2009 Yukihiro Matsumoto <matz@ruby-lang.org> + + * vm_eval.c (check_funcall_failed): should rescue user raised + NoMethodError. rescue all NoMethodError if receiver does not + respond to the method name. [ruby-dev:39796] + Thu Nov 26 21:14:30 2009 Yuki Sonoda (Yugui) <yugui@yugui.jp> * test/ruby/test_complex.rb (@unify): fix the detection if math @@ -255,10 +255,9 @@ check_funcall_exec(struct rescue_funcall_args *args) static VALUE check_funcall_failed(struct rescue_funcall_args *args, VALUE e) { - VALUE sym = rb_funcall(e, rb_intern("name"), 0, 0); - - if (args->sym != sym) + if (rb_respond_to(args->recv, args->sym)) { rb_exc_raise(e); + } return Qundef; } |