summaryrefslogtreecommitdiff
path: root/vm_eval.c
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-06-04 02:49:37 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-06-04 02:49:37 +0000
commitbac9f65f707e8ffcb79389e5b10b32addc94dc01 (patch)
tree0136380e9398eef3a5728564b83146aaafe58b68 /vm_eval.c
parent81a0c608eb73f1a250ec9ec11107280b8d086ef8 (diff)
* vm_core.h (rb_location_t): fix type and field name.
(1) rename rb_location_t to rb_iseq_location_t. (2) rename field names of rb_iseq_location_t to adjust RubyVM::Backtrace::Location methods. (2-1) filename -> path (2-2) filepath -> absolute_path (2-3) basename -> base_label (2-4) name -> label (3) rename filed name rb_iseq_location_t#line_no to rb_iseq_location_t#first_lineno to clear purpose of this field. (4) The field names rb_binding_t#(filename|line_no) are also renamed to rb_binding_t#(path|first_lineno). * compile.c: apply above changes. * iseq.c: ditto. * proc.c: ditto. * vm*.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35899 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_eval.c')
-rw-r--r--vm_eval.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/vm_eval.c b/vm_eval.c
index dee646cdc1..c1b79f5061 100644
--- a/vm_eval.c
+++ b/vm_eval.c
@@ -1019,9 +1019,9 @@ eval_string_with_cref(VALUE self, VALUE src, VALUE scope, NODE *cref, const char
if (rb_obj_is_kind_of(scope, rb_cBinding)) {
GetBindingPtr(scope, bind);
envval = bind->env;
- if (strcmp(file, "(eval)") == 0 && bind->filename != Qnil) {
- file = RSTRING_PTR(bind->filename);
- line = bind->line_no;
+ if (strcmp(file, "(eval)") == 0 && bind->path != Qnil) {
+ file = RSTRING_PTR(bind->path);
+ line = bind->first_lineno;
}
}
else {
@@ -1676,7 +1676,7 @@ rb_current_realfilepath(void)
rb_thread_t *th = GET_THREAD();
rb_control_frame_t *cfp = th->cfp;
cfp = vm_get_ruby_level_caller_cfp(th, RUBY_VM_PREVIOUS_CONTROL_FRAME(cfp));
- if (cfp != 0) return cfp->iseq->location.filepath;
+ if (cfp != 0) return cfp->iseq->location.absolute_path;
return Qnil;
}