summaryrefslogtreecommitdiff
path: root/proc.c
diff options
context:
space:
mode:
authormame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-05-16 08:18:49 +0000
committermame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-05-16 08:18:49 +0000
commit7e7420cc852698eeae6bf6dda96cfd95fa64905b (patch)
tree58aabf16c560ded8e1e85e7fac00e01ccaa621a5 /proc.c
parent6c05f91b3b12c9a52cf36fae2ad6fb7eaf9d53e3 (diff)
* proc.c (proc_binding): don't propagative filename and line_no of
binding that is created from C level. [ruby-dev:41322] * vm_eval.c (eval_string_with_cref): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27817 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'proc.c')
-rw-r--r--proc.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/proc.c b/proc.c
index fc05a8eae0..b4ecd576c8 100644
--- a/proc.c
+++ b/proc.c
@@ -1897,8 +1897,14 @@ proc_binding(VALUE self)
bindval = binding_alloc(rb_cBinding);
GetBindingPtr(bindval, bind);
bind->env = proc->envval;
- bind->filename = proc->block.iseq->filename;
- bind->line_no = rb_iseq_first_lineno(proc->block.iseq);
+ if (RUBY_VM_NORMAL_ISEQ_P(proc->block.iseq)) {
+ bind->filename = proc->block.iseq->filename;
+ bind->line_no = rb_iseq_first_lineno(proc->block.iseq);
+ }
+ else {
+ bind->filename = Qnil;
+ bind->line_no = 0;
+ }
return bindval;
}