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

ruby-changes:32054

From: ko1 <ko1@a...>
Date: Wed, 11 Dec 2013 12:39:59 +0900 (JST)
Subject: [ruby-changes:32054] ko1:r44133 (trunk): * eval.c (rb_raise_jump): pop frame after setup exception.

ko1	2013-12-11 12:39:52 +0900 (Wed, 11 Dec 2013)

  New Revision: 44133

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

  Log:
    * eval.c (rb_raise_jump): pop frame after setup exception.
      Patches by deivid (David Rodriguez). [Bug #8886]
    * test/minitest/test_minitest_unit.rb: catch up this change.
    * test/ruby/test_backtrace.rb: ditto.
    * test/ruby/test_settracefunc.rb: ditto.

  Modified files:
    trunk/ChangeLog
    trunk/eval.c
    trunk/test/minitest/test_minitest_unit.rb
    trunk/test/ruby/test_backtrace.rb
    trunk/test/ruby/test_settracefunc.rb
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 44132)
+++ ChangeLog	(revision 44133)
@@ -1,3 +1,14 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Wed Dec 11 12:38:17 2013  Koichi Sasada  <ko1@a...>
+
+	* eval.c (rb_raise_jump): pop frame after setup exception.
+	  Patches by deivid (David Rodriguez). [Bug #8886]
+
+	* test/minitest/test_minitest_unit.rb: catch up this change.
+
+	* test/ruby/test_backtrace.rb: ditto.
+
+	* test/ruby/test_settracefunc.rb: ditto.
+
 Wed Dec 11 04:54:03 2013  Eric Hodel  <drbrain@s...>
 
 	* lib/rubygems:  Update to RubyGems master ec8ed22.  Notable changes
Index: eval.c
===================================================================
--- eval.c	(revision 44132)
+++ eval.c	(revision 44133)
@@ -688,10 +688,10 @@ rb_raise_jump(VALUE mesg) https://github.com/ruby/ruby/blob/trunk/eval.c#L688
     VALUE self = cfp->self;
     ID mid = cfp->me->called_id;
 
-    th->cfp = RUBY_VM_PREVIOUS_CONTROL_FRAME(th->cfp);
-
     setup_exception(th, TAG_RAISE, mesg);
 
+    th->cfp = RUBY_VM_PREVIOUS_CONTROL_FRAME(th->cfp);
+
     EXEC_EVENT_HOOK(th, RUBY_EVENT_C_RETURN, self, mid, klass, Qnil);
     rb_thread_raised_clear(th);
     JUMP_TAG(TAG_RAISE);
Index: test/ruby/test_backtrace.rb
===================================================================
--- test/ruby/test_backtrace.rb	(revision 44132)
+++ test/ruby/test_backtrace.rb	(revision 44133)
@@ -10,7 +10,7 @@ class TestBacktrace < Test::Unit::TestCa https://github.com/ruby/ruby/blob/trunk/test/ruby/test_backtrace.rb#L10
         e.backtrace
       end
     }.resume
-    assert_equal(1, bt.size)
+    assert_equal(2, bt.size)
     assert_match(/.+:\d+:.+/, bt[0])
   end
 
Index: test/ruby/test_settracefunc.rb
===================================================================
--- test/ruby/test_settracefunc.rb	(revision 44132)
+++ test/ruby/test_settracefunc.rb	(revision 44133)
@@ -257,7 +257,7 @@ class TestSetTraceFunc < Test::Unit::Tes https://github.com/ruby/ruby/blob/trunk/test/ruby/test_settracefunc.rb#L257
                  events.shift)
     assert_equal(["c-return", 5, :backtrace, Exception],
                  events.shift)
-    assert_equal(["raise", 5, :test_raise, TestSetTraceFunc],
+    assert_equal(["raise", 5, :raise, Kernel],
                  events.shift)
     assert_equal(["c-return", 5, :raise, Kernel],
                  events.shift)
@@ -517,7 +517,7 @@ class TestSetTraceFunc < Test::Unit::Tes https://github.com/ruby/ruby/blob/trunk/test/ruby/test_settracefunc.rb#L517
      [:c_return,20, "xyzzy", Exception,   :exception,       RuntimeError, :outer, raised_exc],
      [:c_call,  20, "xyzzy", Exception,   :backtrace,       raised_exc,  :outer, :nothing],
      [:c_return,20, "xyzzy", Exception,   :backtrace,       raised_exc,  :outer, nil],
-     [:raise,   20, "xyzzy", TestSetTraceFunc, :trace_by_tracepoint, self, :outer, raised_exc],
+     [:raise,   20, "xyzzy", Kernel,      :raise,           self,        :outer, raised_exc],
      [:c_return,20, "xyzzy", Kernel,      :raise,           self,        :outer, nil],
      [:c_call,  20, "xyzzy", Module,      :===,             RuntimeError,:outer, :nothing],
      [:c_return,20, "xyzzy", Module,      :===,             RuntimeError,:outer, true],
Index: test/minitest/test_minitest_unit.rb
===================================================================
--- test/minitest/test_minitest_unit.rb	(revision 44132)
+++ test/minitest/test_minitest_unit.rb	(revision 44133)
@@ -296,6 +296,7 @@ class TestMiniTestRunner < MetaMetaMetaT https://github.com/ruby/ruby/blob/trunk/test/minitest/test_minitest_unit.rb#L296
         1) Error:
       #<Class:0xXXX>#test_error:
       RuntimeError: unhandled exception
+          FILE:LINE:in \`raise\'
           FILE:LINE:in \`test_error\'
 
       2 tests, 1 assertions, 0 failures, 1 errors, 0 skips
@@ -323,6 +324,7 @@ class TestMiniTestRunner < MetaMetaMetaT https://github.com/ruby/ruby/blob/trunk/test/minitest/test_minitest_unit.rb#L324
         1) Error:
       #<Class:0xXXX>#test_something:
       RuntimeError: unhandled exception
+          FILE:LINE:in \`raise\'
           FILE:LINE:in \`teardown\'
 
       1 tests, 1 assertions, 0 failures, 1 errors, 0 skips
@@ -1210,6 +1212,7 @@ class TestMiniTestUnitTestCase < MiniTes https://github.com/ruby/ruby/blob/trunk/test/minitest/test_minitest_unit.rb#L1212
       Class: <SyntaxError>
       Message: <\"icky\">
       ---Backtrace---
+      FILE:LINE:in \`raise\'
       FILE:LINE:in \`test_assert_raises_triggered_different\'
       ---------------
     EOM
@@ -1233,6 +1236,7 @@ class TestMiniTestUnitTestCase < MiniTes https://github.com/ruby/ruby/blob/trunk/test/minitest/test_minitest_unit.rb#L1236
       Class: <SyntaxError>
       Message: <\"icky\">
       ---Backtrace---
+      FILE:LINE:in \`raise\'
       FILE:LINE:in \`test_assert_raises_triggered_different_msg\'
       ---------------
     EOM
@@ -1279,6 +1283,7 @@ class TestMiniTestUnitTestCase < MiniTes https://github.com/ruby/ruby/blob/trunk/test/minitest/test_minitest_unit.rb#L1283
       Class: <AnError>
       Message: <\"AnError\">
       ---Backtrace---
+      FILE:LINE:in \`raise\'
       FILE:LINE:in \`test_assert_raises_triggered_subclass\'
       ---------------
     EOM

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

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