diff --git a/compile.c b/compile.c index c7dd5cb281..4ff7472331 100644 --- a/compile.c +++ b/compile.c @@ -288,7 +288,7 @@ struct iseq_compile_data_ensure_node_stack { rb_ary_push(branches, INT2FIX(last_line)); \ rb_ary_push(branches, INT2FIX(last_column)); \ rb_ary_push(branches, INT2FIX(counter_idx)); \ - ADD_INSN2((seq), (first_line), tracebranch, INT2FIX(RUBY_EVENT_COVERAGE), INT2FIX(counter_idx)); \ + ADD_INSN2((seq), (first_line), tracebranch, INT2FIX(RUBY_EVENT_COVERAGE_BRANCH), INT2FIX(counter_idx)); \ } \ } while (0) diff --git a/include/ruby/ruby.h b/include/ruby/ruby.h index ee873182e7..8745fb903a 100644 --- a/include/ruby/ruby.h +++ b/include/ruby/ruby.h @@ -2096,7 +2096,7 @@ int ruby_native_thread_p(void); #define RUBY_EVENT_TRACEPOINT_ALL 0xffff /* special events */ -#define RUBY_EVENT_COVERAGE 0x020000 +#define RUBY_EVENT_RESERVED_FOR_INTERNAL_USE 0x030000 /* internal events */ #define RUBY_INTERNAL_EVENT_SWITCH 0x040000 diff --git a/thread.c b/thread.c index 5c7f1909f2..02c689df05 100644 --- a/thread.c +++ b/thread.c @@ -5106,7 +5106,7 @@ rb_set_coverages(VALUE coverages, int mode, VALUE me2counter) GET_VM()->coverage_mode = mode; rb_add_event_hook2((rb_event_hook_func_t) update_line_coverage, RUBY_EVENT_LINE, Qnil, RUBY_EVENT_HOOK_FLAG_SAFE | RUBY_EVENT_HOOK_FLAG_RAW_ARG); if (mode & COVERAGE_TARGET_BRANCHES) { - rb_add_event_hook2((rb_event_hook_func_t) update_branch_coverage, RUBY_EVENT_COVERAGE, Qnil, RUBY_EVENT_HOOK_FLAG_SAFE | RUBY_EVENT_HOOK_FLAG_RAW_ARG); + rb_add_event_hook2((rb_event_hook_func_t) update_branch_coverage, RUBY_EVENT_COVERAGE_BRANCH, Qnil, RUBY_EVENT_HOOK_FLAG_SAFE | RUBY_EVENT_HOOK_FLAG_RAW_ARG); } if (mode & COVERAGE_TARGET_METHODS) { rb_add_event_hook2((rb_event_hook_func_t) update_method_coverage, RUBY_EVENT_CALL, me2counter, RUBY_EVENT_HOOK_FLAG_SAFE | RUBY_EVENT_HOOK_FLAG_RAW_ARG); diff --git a/vm_core.h b/vm_core.h index 2aa2ba04e2..f458da7203 100644 --- a/vm_core.h +++ b/vm_core.h @@ -1753,6 +1753,9 @@ RUBY_SYMBOL_EXPORT_BEGIN int rb_thread_check_trap_pending(void); +/* #define RUBY_EVENT_RESERVED_FOR_INTERNAL_USE 0x030000 */ /* from vm_core.h */ +#define RUBY_EVENT_COVERAGE_BRANCH 0x010000 + extern VALUE rb_get_coverages(void); extern void rb_set_coverages(VALUE, int, VALUE); extern void rb_reset_coverages(void);