diff options
author | John Hawthorn <[email protected]> | 2023-12-16 01:34:03 -0800 |
---|---|---|
committer | John Hawthorn <[email protected]> | 2023-12-22 18:07:22 -0800 |
commit | 697a096c9b0d8c153cb5d99affb6b5673b7c4210 (patch) | |
tree | bd124f7e228d3628356f757296b91b7f5262922b /vm_trace.c | |
parent | 24ff13d8da711f8004b92e81e95c051feb8a5ce0 (diff) |
Remove EC argument from clean_hooks_check
This argument doesn't seem used anymore. Since we want to free these
objects during VM destruction when RUBY_FREE_AT_EXIT is set they must
work without an EC.
This avoids a use-after-free running `RUBY_FREE_AT_EXIT=1 ./miniruby -e ''`
Diffstat (limited to 'vm_trace.c')
-rw-r--r-- | vm_trace.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/vm_trace.c b/vm_trace.c index a595b3b2fc..e6e60efaec 100644 --- a/vm_trace.c +++ b/vm_trace.c @@ -82,7 +82,7 @@ rb_hook_list_mark_and_update(rb_hook_list_t *hooks) } } -static void clean_hooks(const rb_execution_context_t *ec, rb_hook_list_t *list); +static void clean_hooks(rb_hook_list_t *list); void rb_hook_list_free(rb_hook_list_t *hooks) @@ -90,7 +90,7 @@ rb_hook_list_free(rb_hook_list_t *hooks) hooks->need_clean = true; if (hooks->running == 0) { - clean_hooks(GET_EC(), hooks); + clean_hooks(hooks); } } @@ -223,7 +223,7 @@ rb_add_event_hook2(rb_event_hook_func_t func, rb_event_flag_t events, VALUE data } static void -clean_hooks(const rb_execution_context_t *ec, rb_hook_list_t *list) +clean_hooks(rb_hook_list_t *list) { rb_event_hook_t *hook, **nextp = &list->hooks; rb_event_flag_t prev_events = list->events; @@ -257,11 +257,11 @@ clean_hooks(const rb_execution_context_t *ec, rb_hook_list_t *list) } static void -clean_hooks_check(const rb_execution_context_t *ec, rb_hook_list_t *list) +clean_hooks_check(rb_hook_list_t *list) { if (UNLIKELY(list->need_clean)) { if (list->running == 0) { - clean_hooks(ec, list); + clean_hooks(list); } } } @@ -289,7 +289,7 @@ remove_event_hook(const rb_execution_context_t *ec, const rb_thread_t *filter_th hook = hook->next; } - clean_hooks_check(ec, list); + clean_hooks_check(list); return ret; } @@ -373,7 +373,7 @@ static void exec_hooks_postcheck(const rb_execution_context_t *ec, rb_hook_list_t *list) { list->running--; - clean_hooks_check(ec, list); + clean_hooks_check(list); } static void |