diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-04-25 08:17:24 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-04-25 08:17:24 +0000 |
commit | 5ad56e7c0b5a99df526d3bffbb3c6d3461af73be () | |
tree | 775945357a22bac1bdfce41f16b7e1ee23c7a8d0 /vm_backtrace.c | |
parent | 0adeb1c8ab237280896091e9d2034fabf0d050ab (diff) |
load.c: backtrace of circular require
* load.c (load_lock): print backtrace of circular require via `Warning.warn` [ruby-core:80850] [Bug #13505] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58471 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | vm_backtrace.c | 16 |
1 files changed, 12 insertions, 4 deletions
@@ -772,10 +772,15 @@ rb_backtrace(void) vm_backtrace_print(stderr); } static void oldbt_print_to(void *data, VALUE file, int lineno, VALUE name) { - VALUE output = (VALUE)data; VALUE str = rb_sprintf("\tfrom %"PRIsVALUE":%d:in ", file, lineno); if (NIL_P(name)) { @@ -784,16 +789,19 @@ oldbt_print_to(void *data, VALUE file, int lineno, VALUE name) else { rb_str_catf(str, " `%"PRIsVALUE"'\n", name); } - rb_io_write(output, str); } void -rb_backtrace_print_to(VALUE output) { struct oldbt_arg arg; arg.func = oldbt_print_to; - arg.data = (void *)output; backtrace_each(GET_THREAD(), oldbt_init, oldbt_iter_iseq, |