aboutsummaryrefslogtreecommitdiffstats
path: root/error.c
diff options
context:
space:
mode:
authoreregon <eregon@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-06-13 21:17:48 +0000
committereregon <eregon@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-06-13 21:17:48 +0000
commit708832a0cde68c82d7361a341d86834232ae2bf2 (patch)
tree0d701a8e640bff6a11f3cf29d85bf01069229613 /error.c
parentdef019eac38dfda8c665354b60e5fe3f4563787e (diff)
downloadruby-708832a0cde68c82d7361a341d86834232ae2bf2.tar.gz
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.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/error.c b/error.c
index a18583fad4..05bb070e53 100644
--- a/error.c
+++ b/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);
}
}