aboutsummaryrefslogtreecommitdiffstats
path: root/vm_insnhelper.c
diff options
context:
space:
mode:
authormame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-08-10 07:45:16 +0000
committermame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-08-10 07:45:16 +0000
commit5aa415d9bb6de854d372526ed1a6622494d84195 (patch)
tree0e9e89522cb6fcbb6162d80310871ad71da1ad17 /vm_insnhelper.c
parentc4e8ecb4dc881c443ff0402ecbf303413d65bade (diff)
downloadruby-5aa415d9bb6de854d372526ed1a6622494d84195.tar.gz
insns.def (invokesuper): remove a dummy receiever flag hack for ZSUPER
This is just a refactoring. The receiver of "invokesuper" was a boolean to represent if it is ZSUPER or not. This was used in vm_search_super_method to prohibit ZSUPER call in define_method. (It is currently prohibited because of the limitation of the implementation.) This change removes the hack by introducing an explicit flag, VM_CALL_SUPER, to signal the information. Now, the implementation of "invokesuper" is consistent with "send" instruction. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64268 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_insnhelper.c')
-rw-r--r--vm_insnhelper.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/vm_insnhelper.c b/vm_insnhelper.c
index b8a5112de7..fd892678a6 100644
--- a/vm_insnhelper.c
+++ b/vm_insnhelper.c
@@ -2473,7 +2473,6 @@ vm_search_super_method(const rb_execution_context_t *ec, rb_control_frame_t *reg
struct rb_calling_info *calling, struct rb_call_info *ci, struct rb_call_cache *cc)
{
VALUE current_defined_class, klass;
- VALUE sigval = TOPN(calling->argc);
const rb_callable_method_entry_t *me = rb_vm_frame_method_entry(reg_cfp);
if (!me) {
@@ -2499,7 +2498,7 @@ vm_search_super_method(const rb_execution_context_t *ec, rb_control_frame_t *reg
rb_obj_class(calling->recv), m);
}
- if (me->def->type == VM_METHOD_TYPE_BMETHOD && !sigval) {
+ if (me->def->type == VM_METHOD_TYPE_BMETHOD && (ci->flag & VM_CALL_ZSUPER)) {
rb_raise(rb_eRuntimeError,
"implicit argument passing of super from method defined"
" by define_method() is not supported."