1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* vm_backtrace.c (vm_backtrace_to_ary): Ignore the second argument if

it is nil. [Bug #8884] [ruby-core:57094]

* test/ruby/test_backtrace.rb (test_caller_with_nil_length):
  Test for above.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42905 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
sorah 2013-09-10 05:37:39 +00:00
parent 9c060a59b4
commit 5b46f6c602
3 changed files with 14 additions and 0 deletions

View file

@ -1,3 +1,11 @@
Tue Sep 10 14:37:01 2013 Shota Fukumori <sorah@tubusu.net>
* vm_backtrace.c (vm_backtrace_to_ary): Ignore the second argument if
it is nil. [Bug #8884] [ruby-core:57094]
* test/ruby/test_backtrace.rb (test_caller_with_nil_length):
Test for above.
Tue Sep 10 12:39:17 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
* class.c (method_entry_i): should exclude refined methods from

View file

@ -85,6 +85,10 @@ class TestBacktrace < Test::Unit::TestCase
rec[m]
end
def test_caller_with_nil_length
assert_equal caller(0), caller(0, nil)
end
def test_caller_locations
cs = caller(0); locs = caller_locations(0).map{|loc|
loc.to_s

View file

@ -787,6 +787,8 @@ vm_backtrace_to_ary(rb_thread_t *th, int argc, VALUE *argv, int lev_default, int
rb_scan_args(argc, argv, "02", &level, &vn);
if (argc == 2 && NIL_P(vn)) argc--;
switch (argc) {
case 0:
lev = lev_default + lev_plus;