diff options
author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-12-20 09:41:30 +0000 |
---|---|---|
committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-12-20 09:41:30 +0000 |
commit | 449bf5f93d25690ca282e35d2898be3789058f7e (patch) | |
tree | d757c574e11732d21b823a0f458be3f2b7ac0fd2 | |
parent | d92d9a2661d62faf4a95a400109fd0c9f0ece256 (diff) |
[Backport #7538]
* thread.c (exec_event_hooks): exceptions in event hooks should not
propagate outside.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@38504 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | KNOWNBUGS.rb | 2 | ||||
-rw-r--r-- | thread.c | 11 | ||||
-rw-r--r-- | version.h | 2 |
4 files changed, 18 insertions, 2 deletions
@@ -1,3 +1,8 @@ +Thu Dec 20 18:40:25 2012 Nobuyoshi Nakada <nobu@ruby-lang.org> + + * thread.c (exec_event_hooks): exceptions in event hooks should not + propagate outside. + Thu Dec 20 18:37:45 2012 NARUSE, Yui <naruse@ruby-lang.org> * test/ruby/test_m17n_comb.rb (test_str_crypt): Use RbConfig to get diff --git a/KNOWNBUGS.rb b/KNOWNBUGS.rb index b97a08d928..9bd0227923 100644 --- a/KNOWNBUGS.rb +++ b/KNOWNBUGS.rb @@ -3,3 +3,5 @@ # 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") @@ -4138,16 +4138,25 @@ set_threads_event_flags(int flag) 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; } @@ -1,5 +1,5 @@ #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 |