diff options
author | eregon <eregon@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-06-13 21:17:48 +0000 |
---|---|---|
committer | eregon <eregon@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-06-13 21:17:48 +0000 |
commit | fe7ec526f398671fb079ad30dda413d2fcf17bc1 (patch) | |
tree | 0d701a8e640bff6a11f3cf29d85bf01069229613 /error.c | |
parent | 606d6b34706c590fe0449b0c160281e729be0484 (diff) |
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
Diffstat (limited to 'error.c')
-rw-r--r-- | error.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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); } } |