diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2019-12-10 20:54:01 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2019-12-13 20:47:07 +0900 |
commit | f3b1b645edfc5a8c938da74a5ed44564b9e2fc08 (patch) | |
tree | 179e4a63909d91df39894e98728baf92cc1d8765 /error.c | |
parent | 0b5268afbcf11c299e11102c366e836ae55cc39f (diff) |
Create backtrace location array directly
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/2739
Diffstat (limited to 'error.c')
-rw-r--r-- | error.c | 6 |
1 files changed, 2 insertions, 4 deletions
@@ -292,6 +292,7 @@ warning_write(int argc, VALUE *argv, VALUE buf) return buf; } +VALUE rb_ec_backtrace_location_ary(rb_execution_context_t *ec, long lev, long n); static VALUE rb_warn_m(rb_execution_context_t *ec, VALUE exc, VALUE msgs, VALUE uplevel) { @@ -302,14 +303,11 @@ rb_warn_m(rb_execution_context_t *ec, VALUE exc, VALUE msgs, VALUE uplevel) if (!NIL_P(ruby_verbose) && argc > 0) { VALUE str = argv[0]; if (!NIL_P(uplevel)) { - VALUE args[2]; long lev = NUM2LONG(uplevel); if (lev < 0) { rb_raise(rb_eArgError, "negative level (%ld)", lev); } - args[0] = LONG2NUM(lev + 1); - args[1] = INT2FIX(1); - location = rb_vm_thread_backtrace_locations(2, args, GET_THREAD()->self); + location = rb_ec_backtrace_location_ary(ec, lev + 1, 1); if (!NIL_P(location)) { location = rb_ary_entry(location, 0); } |