[前][次][番号順一覧][スレッド一覧]

ruby-changes:30846

From: nagachika <ko1@a...>
Date: Fri, 13 Sep 2013 01:43:40 +0900 (JST)
Subject: [ruby-changes:30846] nagachika:r42925 (ruby_2_0_0): merge revision(s) 42905: [Backport #8884]

nagachika	2013-09-13 01:43:31 +0900 (Fri, 13 Sep 2013)

  New Revision: 42925

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=42925

  Log:
    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.

  Modified directories:
    branches/ruby_2_0_0/
  Modified files:
    branches/ruby_2_0_0/ChangeLog
    branches/ruby_2_0_0/test/ruby/test_backtrace.rb
    branches/ruby_2_0_0/version.h
    branches/ruby_2_0_0/vm_backtrace.c
Index: ruby_2_0_0/ChangeLog
===================================================================
--- ruby_2_0_0/ChangeLog	(revision 42924)
+++ ruby_2_0_0/ChangeLog	(revision 42925)
@@ -1,3 +1,11 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/ChangeLog#L1
+Fri Sep 13 01:09:59 2013  Shota Fukumori  <sorah@t...>
+
+	* 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.
+
 Fri Sep 13 00:57:54 2013  Nobuyoshi Nakada  <nobu@r...>
 
 	* class.c (method_entry_i): should exclude refined methods from
Index: ruby_2_0_0/vm_backtrace.c
===================================================================
--- ruby_2_0_0/vm_backtrace.c	(revision 42924)
+++ ruby_2_0_0/vm_backtrace.c	(revision 42925)
@@ -787,6 +787,8 @@ vm_backtrace_to_ary(rb_thread_t *th, int https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/vm_backtrace.c#L787
 
     rb_scan_args(argc, argv, "02", &level, &vn);
 
+    if (argc == 2 && NIL_P(vn)) argc--;
+
     switch (argc) {
       case 0:
 	lev = lev_default + lev_plus;
Index: ruby_2_0_0/version.h
===================================================================
--- ruby_2_0_0/version.h	(revision 42924)
+++ ruby_2_0_0/version.h	(revision 42925)
@@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/version.h#L1
 #define RUBY_VERSION "2.0.0"
 #define RUBY_RELEASE_DATE "2013-09-13"
-#define RUBY_PATCHLEVEL 307
+#define RUBY_PATCHLEVEL 308
 
 #define RUBY_RELEASE_YEAR 2013
 #define RUBY_RELEASE_MONTH 9
Index: ruby_2_0_0/test/ruby/test_backtrace.rb
===================================================================
--- ruby_2_0_0/test/ruby/test_backtrace.rb	(revision 42924)
+++ ruby_2_0_0/test/ruby/test_backtrace.rb	(revision 42925)
@@ -85,6 +85,10 @@ class TestBacktrace < Test::Unit::TestCa https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/test/ruby/test_backtrace.rb#L85
     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

Property changes on: ruby_2_0_0
___________________________________________________________________
Modified: svn:mergeinfo
   Merged /trunk:r42905


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]