summaryrefslogtreecommitdiff
path: root/vm.c
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-06-18 09:01:00 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-06-18 09:01:00 +0000
commit58ba24f8858ed4e9cae3dfe5aa8e62e0c6316878 (patch)
treeb6c7b3000ac07c90ce4003631d2261afeb3d26a0 /vm.c
parentf74fdd72f3c5a2e69e7e71a0f396c65d7b3ed302 (diff)
* vm.c (rb_vm_control_frame_id_and_class): remove usless codes.
`me' knows ID and owner class. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50950 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm.c')
-rw-r--r--vm.c23
1 files changed, 4 insertions, 19 deletions
diff --git a/vm.c b/vm.c
index 006b0f8a80..69b594f950 100644
--- a/vm.c
+++ b/vm.c
@@ -1738,31 +1738,16 @@ rb_iseq_eval_main(VALUE iseqval)
int
rb_vm_control_frame_id_and_class(const rb_control_frame_t *cfp, ID *idp, VALUE *klassp)
{
- rb_iseq_t *iseq = cfp->iseq;
const rb_method_entry_t *me = rb_vm_frame_method_entry(cfp);
- if (!iseq && me) { /* TODO: me should know all */
+ if (me) {
if (idp) *idp = me->def->original_id;
if (klassp) *klassp = me->klass;
- return 1;
+ return TRUE;
}
- while (iseq) {
- if (RUBY_VM_IFUNC_P(iseq)) {
- if (idp) *idp = idIFUNC;
- if (klassp) *klassp = 0;
- return 1;
- }
- if (iseq->defined_method_id) {
- if (idp) *idp = iseq->defined_method_id;
- if (klassp) *klassp = iseq->klass;
- return 1;
- }
- if (iseq->local_iseq == iseq) {
- break;
- }
- iseq = iseq->parent_iseq;
+ else {
+ return FALSE;
}
- return 0;
}
int