Project

General

Profile

Backport #8884

`caller(1, nil)` raises a runtime error while its reference says its signature as `caller(start=1, length=nil)`

Added by gfx (Goro FUJI) almost 6 years ago. Updated almost 6 years ago.

Status:
Closed
Priority:
Normal
[ruby-core:57094]

Description

$ ruby -e 'caller(1, nil)'
-e:1:in caller': no implicit conversion from nil to integer (TypeError)
from -e:1:in
'

Either the behaviour or the document looks wrong; I don't know which is wrong, though.

Associated revisions

Revision 5b46f6c6
Added by sorah (Sorah Fukumori) almost 6 years ago

  • 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

Revision 42905
Added by sorah (Sorah Fukumori) almost 6 years ago

  • 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.

Revision 42905
Added by sorah (Sorah Fukumori) almost 6 years ago

  • 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.

Revision 42905
Added by sorah (Sorah Fukumori) almost 6 years ago

  • 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.

Revision 42905
Added by sorah (Sorah Fukumori) almost 6 years ago

  • 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.

Revision 42905
Added by sorah (Sorah Fukumori) almost 6 years ago

  • 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.

Revision 42905
Added by sorah (Sorah Fukumori) almost 6 years ago

  • 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.

Revision acdfd915
Added by nagachika (Tomoyuki Chikanaga) almost 6 years ago

merge revision(s) 42905: [Backport #8884]

    * 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/branches/ruby_2_0_0@42925 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 42925
Added by nagachika (Tomoyuki Chikanaga) almost 6 years ago

merge revision(s) 42905: [Backport #8884]

* 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.

History

Updated by sorah (Sorah Fukumori) almost 6 years ago

  • Status changed from Open to Assigned
  • Assignee set to ko1 (Koichi Sasada)

This patch fixes: https://gist.github.com/sorah/6503895

I'll commit this if doc is correct.

#3

Updated by sorah (Sorah Fukumori) almost 6 years ago

  • Status changed from Assigned to Closed
  • % Done changed from 0 to 100

This issue was solved with changeset r42905.
Goro, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


  • 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.

Updated by sorah (Sorah Fukumori) almost 6 years ago

  • Backport changed from 1.9.3: UNKNOWN, 2.0.0: UNKNOWN to 1.9.3: UNKNOWN, 2.0.0: REQUIRED

documentation on 2.0.0 is same, so flagging as backport onto 2.0.0 needed.

#5

Updated by nagachika (Tomoyuki Chikanaga) almost 6 years ago

  • Tracker changed from Bug to Backport
  • Project changed from Ruby master to Backport200
  • Status changed from Closed to Assigned
  • Assignee changed from ko1 (Koichi Sasada) to nagachika (Tomoyuki Chikanaga)

On 1.9.3, Kernel#caller has only one argument.
I will move this ticket to Backport 200.

#6

Updated by nagachika (Tomoyuki Chikanaga) almost 6 years ago

  • Status changed from Assigned to Closed

This issue was solved with changeset r42925.
Goro, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


merge revision(s) 42905: [Backport #8884]

* 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.

Also available in: Atom PDF