raise_exception_inside_raise_method.patch

David Rodríguez, 10/11/2013 10:42 PM

Download (3.83 KB)

View differences:

eval.c
660 660
    VALUE self = cfp->self;
661 661
    ID mid = cfp->me->called_id;
662 662

  
663
    th->cfp = RUBY_VM_PREVIOUS_CONTROL_FRAME(th->cfp);
664

  
665 663
    setup_exception(th, TAG_RAISE, mesg);
666 664

  
665
    th->cfp = RUBY_VM_PREVIOUS_CONTROL_FRAME(th->cfp);
666

  
667 667
    EXEC_EVENT_HOOK(th, RUBY_EVENT_C_RETURN, self, mid, klass, Qnil);
668 668
    rb_thread_raised_clear(th);
669 669
    JUMP_TAG(TAG_RAISE);
test/minitest/test_minitest_unit.rb
296 296
        1) Error:
297 297
      #<Class:0xXXX>#test_error:
298 298
      RuntimeError: unhandled exception
299
          FILE:LINE:in \`raise\'
299 300
          FILE:LINE:in \`test_error\'
300 301

  
301 302
      2 tests, 1 assertions, 0 failures, 1 errors, 0 skips
......
323 324
        1) Error:
324 325
      #<Class:0xXXX>#test_something:
325 326
      RuntimeError: unhandled exception
327
          FILE:LINE:in \`raise\'
326 328
          FILE:LINE:in \`teardown\'
327 329

  
328 330
      1 tests, 1 assertions, 0 failures, 1 errors, 0 skips
......
1210 1212
      Class: <SyntaxError>
1211 1213
      Message: <\"icky\">
1212 1214
      ---Backtrace---
1215
      FILE:LINE:in \`raise\'
1213 1216
      FILE:LINE:in \`test_assert_raises_triggered_different\'
1214 1217
      ---------------
1215 1218
    EOM
......
1233 1236
      Class: <SyntaxError>
1234 1237
      Message: <\"icky\">
1235 1238
      ---Backtrace---
1239
      FILE:LINE:in \`raise\'
1236 1240
      FILE:LINE:in \`test_assert_raises_triggered_different_msg\'
1237 1241
      ---------------
1238 1242
    EOM
......
1279 1283
      Class: <AnError>
1280 1284
      Message: <\"AnError\">
1281 1285
      ---Backtrace---
1286
      FILE:LINE:in \`raise\'
1282 1287
      FILE:LINE:in \`test_assert_raises_triggered_subclass\'
1283 1288
      ---------------
1284 1289
    EOM
test/ruby/test_backtrace.rb
10 10
        e.backtrace
11 11
      end
12 12
    }.resume
13
    assert_equal(1, bt.size)
13
    assert_equal(2, bt.size)
14 14
    assert_match(/.+:\d+:.+/, bt[0])
15 15
  end
16 16

  
test/ruby/test_settracefunc.rb
251 251
                 events.shift)
252 252
    assert_equal(["c-return", 5, :backtrace, Exception],
253 253
                 events.shift)
254
    assert_equal(["raise", 5, :test_raise, TestSetTraceFunc],
254
    assert_equal(["raise", 5, :raise, Kernel],
255 255
                 events.shift)
256 256
    assert_equal(["c-return", 5, :raise, Kernel],
257 257
                 events.shift)
......
511 511
     [:c_return,20, "xyzzy", Exception,   :exception,       RuntimeError, :outer, raised_exc],
512 512
     [:c_call,  20, "xyzzy", Exception,   :backtrace,       raised_exc,  :outer, :nothing],
513 513
     [:c_return,20, "xyzzy", Exception,   :backtrace,       raised_exc,  :outer, nil],
514
     [:raise,   20, "xyzzy", TestSetTraceFunc, :trace_by_tracepoint, self, :outer, raised_exc],
514
     [:raise,   20, "xyzzy", Kernel,      :raise,           self,        :outer, raised_exc],
515 515
     [:c_return,20, "xyzzy", Kernel,      :raise,           self,        :outer, nil],
516 516
     [:c_call,  20, "xyzzy", Module,      :===,             RuntimeError,:outer, :nothing],
517 517
     [:c_return,20, "xyzzy", Module,      :===,             RuntimeError,:outer, true],