summaryrefslogtreecommitdiff
path: root/compile.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-06-11 11:21:01 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-06-11 11:21:01 +0000
commit5aff6f294821574e54f458d547cf9641dd2eca98 (patch)
tree2a42e7b39dc27d1c8a657bfbb0422d46fa4ea2f0 /compile.c
parent1ea17be1522343d0a598b182f4fd6a9e8b8e270d (diff)
expand ruby_sourcefile
* compile.c: expand ruby_sourcefile not to evaluate twice in RSTRING_PTR. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59060 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'compile.c')
-rw-r--r--compile.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/compile.c b/compile.c
index db88bab809..afbba0b8e3 100644
--- a/compile.c
+++ b/compile.c
@@ -529,8 +529,6 @@ iseq_add_mark_object(const rb_iseq_t *iseq, VALUE v)
return COMPILE_OK;
}
-#define ruby_sourcefile RSTRING_PTR(rb_iseq_path(iseq))
-
static int
iseq_add_mark_object_compile_time(const rb_iseq_t *iseq, VALUE v)
{
@@ -3250,7 +3248,8 @@ when_vals(rb_iseq_t *iseq, LINK_ANCHOR *const cond_seq, NODE *vals,
}
else {
if (rb_hash_lookup(literals, lit) != Qnil) {
- rb_compile_warning(ruby_sourcefile, nd_line(val),
+ VALUE file = rb_iseq_path(iseq);
+ rb_compile_warning(RSTRING_PTR(file), nd_line(val),
"duplicated when clause is ignored");
}
else {