=begin
If I raise an ArgumentError by calling a method with wrong number of arguments, Exception#backtrace_locations returns nil, which I think is a bug:
def foo; end
begin
foo(:bar)
rescue => e
p e.backtrace_locations
end
# => nil
If, instead, I raise an error manually, then it returns an array as expected:
begin
raise ArgumentError.new
rescue => e
p e.backtrace_locations
end
# => ["this_file:2:in `<main>'"]
This issue was solved with changeset r44411.
Tsuyoshi, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.
vm_insnhelper.c (argument_error): insert dummy frame to make
a backtrace object intead of modify backtrace string array.
[Bug #9295]
test/ruby/test_backtrace.rb: add a test for this patch.
fix test to compare a result of Exception#backtrace with
a result of Exception#backtrace_locations.