зеркало из https://github.com/github/ruby.git
Fix condition in Kernel#warn when using uplevel
* It causes SEGV on `warn("foo", uplevel: 100)`. * Found in a ruby/spec added by @andrykonchin in https://github.com/ruby/spec/pull/605 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63650 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
606d6b3470
Коммит
fe7ec526f3
2
error.c
2
error.c
|
@ -371,7 +371,7 @@ rb_warn_m(int argc, VALUE *argv, VALUE exc)
|
|||
args[0] = LONG2NUM(lev + 1);
|
||||
args[1] = INT2FIX(1);
|
||||
location = rb_vm_thread_backtrace_locations(2, args, GET_THREAD()->self);
|
||||
if (!NIL_P(uplevel)) {
|
||||
if (!NIL_P(location)) {
|
||||
location = rb_ary_entry(location, 0);
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче