diff options
Diffstat (limited to 'insns.def')
-rw-r--r-- | insns.def | 12 |
1 files changed, 11 insertions, 1 deletions
@@ -847,11 +847,21 @@ defined */ DEFINE_INSN trace -(rb_num_t nf) +(rb_num_t nf, VALUE coverage) () () { rb_event_flag_t flag = nf; + if (coverage) { + long line = rb_sourceline() - 1; + if (RARRAY_PTR(coverage)[line] == Qnil) { + rb_bug("bug"); + } + long count = FIX2LONG(RARRAY_PTR(coverage)[line]) + 1; + if (POSFIXABLE(count)) { + RARRAY_PTR(coverage)[line] = LONG2FIX(count); + } + } EXEC_EVENT_HOOK(th, flag, GET_SELF(), 0, 0 /* TODO: id, klass */); } |