aboutsummaryrefslogtreecommitdiffstats
path: root/error.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
commit43886f3804567d8330eb3797d40065e0e7001cf5 (patch)
tree2ecaaf2cb405cdf4bdcbf420966fc3213c44a322 /error.c
parent4726e6349ace31e28460725ef542b481fc2ea3ca (diff)
downloadruby-43886f3804567d8330eb3797d40065e0e7001cf5.tar.gz
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 'error.c')
-rw-r--r--error.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/error.c b/error.c
index 1db0e74a09..3dbdb5240f 100644
--- a/error.c
+++ b/error.c
@@ -199,10 +199,10 @@ static VALUE
warning_string(rb_encoding *enc, const char *fmt, va_list args)
{
VALUE str = rb_enc_str_new(0, 0, enc);
- VALUE file = rb_sourcefilename();
+ int line;
+ VALUE file = rb_source_location(&line);
if (!NIL_P(file)) {
- int line = rb_sourceline();
str = rb_str_append(str, file);
if (line) rb_str_catf(str, ":%d", line);
rb_str_cat2(str, ": ");
@@ -399,8 +399,7 @@ rb_bug(const char *fmt, ...)
int line = 0;
if (GET_THREAD()) {
- file = rb_sourcefile();
- line = rb_sourceline();
+ file = rb_source_loc(&line);
}
report_bug(file, line, fmt, NULL);
@@ -415,8 +414,7 @@ rb_bug_context(const void *ctx, const char *fmt, ...)
int line = 0;
if (GET_THREAD()) {
- file = rb_sourcefile();
- line = rb_sourceline();
+ file = rb_source_loc(&line);
}
report_bug(file, line, fmt, ctx);