diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-10-27 08:12:52 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-10-27 08:12:52 +0000 |
commit | 9bcf16f01a7d5d3b1e4c19b146a9426b44891a35 (patch) | |
tree | eb1b8d0814619db3c99eb8f64e4ca17800dc5f3f /proc.c | |
parent | ed8da2d12ae041b0536d3303659dc98411c2ec4f (diff) |
proc.c: local variable
* proc.c (proc_binding): extract a local variable.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48159 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'proc.c')
-rw-r--r-- | proc.c | 12 |
1 files changed, 7 insertions, 5 deletions
@@ -2450,10 +2450,12 @@ proc_binding(VALUE self) rb_proc_t *proc; VALUE bindval; rb_binding_t *bind; + rb_iseq_t *iseq; GetProcPtr(self, proc); - if (RB_TYPE_P((VALUE)proc->block.iseq, T_NODE)) { - if (!IS_METHOD_PROC_NODE((NODE *)proc->block.iseq)) { + iseq = proc->block.iseq; + if (RB_TYPE_P((VALUE)iseq, T_NODE)) { + if (!IS_METHOD_PROC_NODE((NODE *)iseq)) { rb_raise(rb_eArgError, "Can't create Binding from C level Proc"); } } @@ -2462,9 +2464,9 @@ proc_binding(VALUE self) GetBindingPtr(bindval, bind); bind->env = proc->envval; bind->blockprocval = proc->blockprocval; - if (RUBY_VM_NORMAL_ISEQ_P(proc->block.iseq)) { - bind->path = proc->block.iseq->location.path; - bind->first_lineno = FIX2INT(rb_iseq_first_lineno(proc->block.iseq->self)); + if (RUBY_VM_NORMAL_ISEQ_P(iseq)) { + bind->path = iseq->location.path; + bind->first_lineno = FIX2INT(rb_iseq_first_lineno(iseq->self)); } else { bind->path = Qnil; |