mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
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:
parent
606d6b3470
commit
fe7ec526f3
1 changed files with 1 additions and 1 deletions
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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue