summaryrefslogtreecommitdiff
path: root/vm_eval.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-10-31 01:02:26 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-10-31 01:02:26 +0000
commit1546ffed499aa40e905485b00293fbb530d7ebd1 (patch)
tree2ecaaf2cb405cdf4bdcbf420966fc3213c44a322 /vm_eval.c
parent954224f3c53a66004c7171c139b1a45668d91858 (diff)
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
Diffstat (limited to 'vm_eval.c')
-rw-r--r--vm_eval.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/vm_eval.c b/vm_eval.c
index ffb3a6b..4634b98 100644
--- a/vm_eval.c
+++ b/vm_eval.c
@@ -1252,7 +1252,8 @@ rb_each(VALUE obj)
}
static VALUE
-eval_string_with_cref(VALUE self, VALUE src, VALUE scope, rb_cref_t *const cref_arg, volatile VALUE file, volatile int line)
+eval_string_with_cref(VALUE self, VALUE src, VALUE scope, rb_cref_t *const cref_arg,
+ VALUE filename, int lineno)
{
int state;
VALUE result = Qundef;
@@ -1264,11 +1265,11 @@ eval_string_with_cref(VALUE self, VALUE src, VALUE scope, rb_cref_t *const cref_
volatile int mild_compile_error;
rb_cref_t *orig_cref;
VALUE crefval;
+ volatile VALUE file;
+ volatile int line;
- if (file == 0) {
- file = rb_sourcefilename();
- line = rb_sourceline();
- }
+ file = filename ? filename : rb_source_location(&lineno);
+ line = lineno;
parse_in_eval = th->parse_in_eval;
mild_compile_error = th->mild_compile_error;