From 1546ffed499aa40e905485b00293fbb530d7ebd1 Mon Sep 17 00:00:00 2001 From: nobu Date: Sat, 31 Oct 2015 01:02:26 +0000 Subject: use rb_source_loc and rb_source_location * error.c, eval.c, eval_error.c, gc.c, variable.c, vm.c, vm_eval.c, vm_trace.c: use rb_source_loc/rb_source_location instead of combination of rb_sourcefile/rb_sourcefilename and rb_sourceline. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52398 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- vm.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'vm.c') diff --git a/vm.c b/vm.c index d79d38a8d9..1e2b4dc1c4 100644 --- a/vm.c +++ b/vm.c @@ -203,16 +203,14 @@ ruby_th_dtrace_setup(rb_thread_t *th, VALUE klass, ID id, type = BUILTIN_TYPE(klass); if (type == T_CLASS || type == T_ICLASS || type == T_MODULE) { VALUE name = rb_class_path_no_cache(klass); - const char *classname; + const char *classname, *filename; const char *methodname = rb_id2name(id); - const char *filename = rb_sourcefile(); - if (methodname && filename) { + if (methodname && (filename = rb_source_loc(&args->line_no)) != 0) { if (NIL_P(name) || !(classname = StringValuePtr(name))) classname = ""; args->classname = classname; args->methodname = methodname; args->filename = filename; - args->line_no = rb_sourceline(); args->klass = klass; args->name = name; return TRUE; -- cgit v1.2.3