summaryrefslogtreecommitdiff
path: root/load.c
diff options
context:
space:
mode:
authoreregon <eregon@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-04-27 12:07:43 (GMT)
committereregon <eregon@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-04-27 12:07:43 (GMT)
commitacde55201b35c5d1d8d08bcd4273d3adfb6115cf (patch)
tree107b6299c92cefc50928b8f86f737aa087f177a9 /load.c
parent29ca20de2d998d21c0d41224799182020311ea76 (diff)
Send the backtrace of the circular require warning as a single String to Warning.warn
* load.c: send as a single string. * error.c: expose the string formatted by rb_warning as rb_warning_string(). * test/ruby/test_exception.rb: update tests. [ruby-core:80850] [Bug #13505] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58493 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'load.c')
-rw-r--r--load.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/load.c b/load.c
index 7d53b87..1fddbf5 100644
--- a/load.c
+++ b/load.c
@@ -743,8 +743,9 @@ load_lock(const char *ftptr)
return (char *)"";
}
if (RTEST(ruby_verbose)) {
- rb_warning("loading in progress, circular require considered harmful - %s", ftptr);
- rb_backtrace_each(rb_warning_warn, rb_mWarning);
+ VALUE warning = rb_warning_string("loading in progress, circular require considered harmful - %s", ftptr);
+ rb_backtrace_each(rb_str_append, warning);
+ rb_warning_warn(rb_mWarning, warning);
}
switch (rb_thread_shield_wait((VALUE)data)) {
case Qfalse: