Skip to content

Commit

Permalink
merge revision(s) 25670:
Browse files Browse the repository at this point in the history
	* eval.c (call_trace_func): remove the trace hook if any exception
	  raised.  [ruby-list:46515]


git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8_7@26082 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
shyouhei committed Dec 13, 2009
1 parent 23fc27a commit 56e9a83
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 2 deletions.
5 changes: 5 additions & 0 deletions ChangeLog
@@ -1,3 +1,8 @@
Mon Dec 14 03:21:59 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>

* eval.c (call_trace_func): remove the trace hook if any exception
raised. [ruby-list:46515]

Mon Dec 14 02:27:32 2009 Yusuke Endoh <mame@tsg.ne.jp>

* hash.c (rb_hash): always return a fixnum value because a return
Expand Down
6 changes: 5 additions & 1 deletion eval.c
Expand Up @@ -2772,7 +2772,11 @@ call_trace_func(event, node, self, id, klass)
tracing = 0;
ruby_current_node = node_save;
SET_CURRENT_SOURCE();
if (state) JUMP_TAG(state);
if (state) {
trace_func = 0;
rb_remove_event_hook(call_trace_func);
JUMP_TAG(state);
}
}

static VALUE
Expand Down
5 changes: 5 additions & 0 deletions test/ruby/test_settracefunc.rb
Expand Up @@ -135,4 +135,9 @@ def test_event
assert_equal(["c-call", 131, :set_trace_func, Kernel], events.shift)
assert_equal([], events)
end

def test_bad_trace
e = Class.new(RuntimeError)
assert_raise(e) {set_trace_func proc{raise e}}
end
end
2 changes: 1 addition & 1 deletion version.h
Expand Up @@ -2,7 +2,7 @@
#define RUBY_RELEASE_DATE "2009-12-14"
#define RUBY_VERSION_CODE 187
#define RUBY_RELEASE_CODE 20091214
#define RUBY_PATCHLEVEL 228
#define RUBY_PATCHLEVEL 229

#define RUBY_VERSION_MAJOR 1
#define RUBY_VERSION_MINOR 8
Expand Down

0 comments on commit 56e9a83

Please sign in to comment.