Project

General

Profile

Bug #14834 ยป pc-treatment.diff

kivikakk (Ashe Connor), 06/08/2018 05:06 AM

View differences:

gc.c
1805 1805
static void
1806 1806
gc_event_hook_body(rb_execution_context_t *ec, rb_objspace_t *objspace, const rb_event_flag_t event, VALUE data)
1807 1807
{
1808
    /* increment PC because source line is calculated with PC-1 */
1809
    ec->cfp->pc++;
1808
    /* increment PC because source line is calculated with PC-1,
1809
     * unless we're not an iseq */
1810
    bool treat_pc = ec->cfp->pc;
1811
    if (treat_pc) {
1812
        ec->cfp->pc++;
1813
    }
1810 1814
    EXEC_EVENT_HOOK(ec, event, ec->cfp->self, 0, 0, 0, data);
1811
    ec->cfp->pc--;
1815
    if (treat_pc) {
1816
        ec->cfp->pc--;
1817
    }
1812 1818
}
1813 1819

  
1814 1820
#define gc_event_hook_available_p(objspace) ((objspace)->flags.has_hook)