summaryrefslogtreecommitdiff
path: root/vm_backtrace.c
diff options
context:
space:
mode:
authorsorah <sorah@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-09-10 05:37:39 +0000
committersorah <sorah@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-09-10 05:37:39 +0000
commit5b46f6c602c24c9cdf995914fc6998981f1e53ec (patch)
tree70e7a6abf8489def3ada6065e90f8ef784dd011c /vm_backtrace.c
parent9c060a59b42f038e55e8b3662ae6a8db99fae67d (diff)
* 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
Diffstat (limited to 'vm_backtrace.c')
-rw-r--r--vm_backtrace.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/vm_backtrace.c b/vm_backtrace.c
index 3287c1f..3945993 100644
--- a/vm_backtrace.c
+++ b/vm_backtrace.c
@@ -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;