ruby-changes:26453
From: usa <ko1@a...>
Date: Thu, 20 Dec 2012 18:41:40 +0900 (JST)
Subject: [ruby-changes:26453] usa:r38504 (ruby_1_9_3): [Backport #7538]
usa 2012-12-20 18:41:30 +0900 (Thu, 20 Dec 2012) New Revision: 38504 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=38504 Log: [Backport #7538] * thread.c (exec_event_hooks): exceptions in event hooks should not propagate outside. Modified files: branches/ruby_1_9_3/ChangeLog branches/ruby_1_9_3/KNOWNBUGS.rb branches/ruby_1_9_3/thread.c branches/ruby_1_9_3/version.h Index: ruby_1_9_3/ChangeLog =================================================================== --- ruby_1_9_3/ChangeLog (revision 38503) +++ ruby_1_9_3/ChangeLog (revision 38504) @@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ruby_1_9_3/ChangeLog#L1 +Thu Dec 20 18:40:25 2012 Nobuyoshi Nakada <nobu@r...> + + * thread.c (exec_event_hooks): exceptions in event hooks should not + propagate outside. + Thu Dec 20 18:37:45 2012 NARUSE, Yui <naruse@r...> * test/ruby/test_m17n_comb.rb (test_str_crypt): Use RbConfig to get Index: ruby_1_9_3/thread.c =================================================================== --- ruby_1_9_3/thread.c (revision 38503) +++ ruby_1_9_3/thread.c (revision 38504) @@ -4138,16 +4138,25 @@ set_threads_event_flags(int flag) https://github.com/ruby/ruby/blob/trunk/ruby_1_9_3/thread.c#L4138 static inline int exec_event_hooks(const rb_event_hook_t *hook, rb_event_flag_t flag, VALUE self, ID id, VALUE klass) { - int removed = 0; + volatile int removed = 0; + const rb_event_hook_t *volatile hnext = 0; + int state; + + PUSH_TAG(); + if ((state = EXEC_TAG()) != 0) { + hook = hnext; + } for (; hook; hook = hook->next) { if (hook->flag & RUBY_EVENT_REMOVED) { removed++; continue; } if (flag & hook->flag) { + hnext = hook->next; (*hook->func)(flag, hook->data, self, id, klass); } } + POP_TAG(); return removed; } Index: ruby_1_9_3/KNOWNBUGS.rb =================================================================== --- ruby_1_9_3/KNOWNBUGS.rb (revision 38503) +++ ruby_1_9_3/KNOWNBUGS.rb (revision 38504) @@ -3,3 +3,5 @@ https://github.com/ruby/ruby/blob/trunk/ruby_1_9_3/KNOWNBUGS.rb#L3 # So all tests will cause failure. # +assert_equal('ok', "set_trace_func(proc{|t,|raise if t == 'line'})\n""1\n'ok'") +assert_finish(3, "def m; end\n""set_trace_func(proc{|t,|raise if t == 'return'})\n""m") Index: ruby_1_9_3/version.h =================================================================== --- ruby_1_9_3/version.h (revision 38503) +++ ruby_1_9_3/version.h (revision 38504) @@ -1,5 +1,5 @@ https://github.com/ruby/ruby/blob/trunk/ruby_1_9_3/version.h#L1 #define RUBY_VERSION "1.9.3" -#define RUBY_PATCHLEVEL 350 +#define RUBY_PATCHLEVEL 351 #define RUBY_RELEASE_DATE "2012-12-20" #define RUBY_RELEASE_YEAR 2012 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/