summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-08-07 04:33:33 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-08-07 04:33:33 +0000
commitfd0485acf7936e865903d643715433a7b861afbb (patch)
treeefb5eb5d1bb8b83e8daa7d726cbc1c19cf4d26f6
parent93426cd6e883bd436b73c32a08cd14a29b10b7f4 (diff)
* vm_eval.c (vm_call0): fix for VM_METHOD_TYPE_NOTIMPLEMENTED.
[ruby-dev:41953] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28895 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--ext/-test-/bug-3662/bug.c16
-rw-r--r--ext/-test-/bug-3662/extconf.rb1
-rw-r--r--test/-ext-/test_bug-3662.rb10
-rw-r--r--vm_eval.c1
5 files changed, 33 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 45b43f9..c5de296 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Sat Aug 7 13:33:25 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * vm_eval.c (vm_call0): fix for VM_METHOD_TYPE_NOTIMPLEMENTED.
+ [ruby-dev:41953]
+
Sat Aug 7 09:47:06 2010 Masaki Suketa <masaki.suketa@nifty.ne.jp>
* ext/win32ole/win32ole.c: fix checking version of GCC.
diff --git a/ext/-test-/bug-3662/bug.c b/ext/-test-/bug-3662/bug.c
new file mode 100644
index 0000000..9375dac
--- /dev/null
+++ b/ext/-test-/bug-3662/bug.c
@@ -0,0 +1,16 @@
+#include <ruby.h>
+
+static VALUE
+bug_funcall(int argc, VALUE *argv, VALUE self)
+{
+ if (argc < 1) rb_raise(rb_eArgError, "not enough argument");
+ return rb_funcall2(self, rb_to_id(*argv), argc-1, argv+1);
+}
+
+void
+Init_bug(void)
+{
+ VALUE mBug = rb_define_module("Bug");
+ rb_define_module_function(mBug, "funcall", bug_funcall, -1);
+ rb_define_module_function(mBug, "notimplement", rb_f_notimplement, -1);
+}
diff --git a/ext/-test-/bug-3662/extconf.rb b/ext/-test-/bug-3662/extconf.rb
new file mode 100644
index 0000000..7a1b730
--- /dev/null
+++ b/ext/-test-/bug-3662/extconf.rb
@@ -0,0 +1 @@
+create_makefile("-test-/bug-3662/bug")
diff --git a/test/-ext-/test_bug-3662.rb b/test/-ext-/test_bug-3662.rb
new file mode 100644
index 0000000..73c0697
--- /dev/null
+++ b/test/-ext-/test_bug-3662.rb
@@ -0,0 +1,10 @@
+require '-test-/bug-3662/bug'
+
+class Test_BUG_3662 < Test::Unit::TestCase
+ def test_funcall_notimplement
+ bug3662 = '[ruby-dev:41953]'
+ assert_raise(NotImplementedError, bug3662) {
+ Bug.funcall(:notimplement)
+ }
+ end
+end
diff --git a/vm_eval.c b/vm_eval.c
index 122837b..ca3fbba 100644
--- a/vm_eval.c
+++ b/vm_eval.c
@@ -66,6 +66,7 @@ vm_call0(rb_thread_t* th, VALUE recv, VALUE id, int argc, const VALUE *argv,
val = vm_exec(th);
break;
}
+ case VM_METHOD_TYPE_NOTIMPLEMENTED:
case VM_METHOD_TYPE_CFUNC: {
EXEC_EVENT_HOOK(th, RUBY_EVENT_C_CALL, recv, id, klass);
{