summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog9
-rw-r--r--insns.def6
-rw-r--r--vm_insnhelper.c5
3 files changed, 20 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index c4fa0d0062..efa9b8640a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+Fri May 28 00:32:25 2010 Yusuke Endoh <mame@tsg.ne.jp>
+
+ * insns.def (invokesuper): check consistency between class of self and
+ class of method being invoked by super. This is temporary measure
+ for YARV. See [ruby-core:30313] in detail. See [ruby-dev:40959]
+ [ruby-dev:39772] [ruby-core:27000] [ruby-core:27230]
+
+ * vm_insnhelper.c (vm_search_superclass): ditto.
+
Thu May 27 12:42:23 2010 Akinori MUSHA <knu@iDaemons.org>
* LGPL: Removed. We no longer have LGPL'd source files in our
diff --git a/insns.def b/insns.def
index 79b92d8a4d..23c0143907 100644
--- a/insns.def
+++ b/insns.def
@@ -1022,6 +1022,12 @@ invokesuper
recv = GET_SELF();
vm_search_superclass(GET_CFP(), GET_ISEQ(), recv, TOPN(num), &id, &klass);
+
+ /* temporary measure for [Bug #2402] [Bug #2502] [Bug #3136] */
+ if (!rb_obj_is_kind_of(recv, klass)) {
+ rb_raise(rb_eNotImpError, "super from singleton method that is defined to multiple classes is not supported; this will be fixed in 1.9.3 or later");
+ }
+
me = rb_method_entry(klass, id);
CALL_METHOD(num, blockptr, flag, id, me, recv);
diff --git a/vm_insnhelper.c b/vm_insnhelper.c
index 0bd29b5208..3b442c8d9e 100644
--- a/vm_insnhelper.c
+++ b/vm_insnhelper.c
@@ -1402,6 +1402,11 @@ vm_search_superclass(rb_control_frame_t *reg_cfp, rb_iseq_t *ip,
}
}
+ /* temporary measure for [Bug #2420] [Bug #3136] */
+ if (!lcfp->me) {
+ rb_raise(rb_eNoMethodError, "super called outside of method");
+ }
+
id = lcfp->me->def->original_id;
klass = vm_search_normal_superclass(lcfp->me->klass, recv);
}