Bug #14834 ยป pc-treatment.diff
| gc.c | ||
|---|---|---|
|
static void
|
||
|
gc_event_hook_body(rb_execution_context_t *ec, rb_objspace_t *objspace, const rb_event_flag_t event, VALUE data)
|
||
|
{
|
||
|
/* increment PC because source line is calculated with PC-1 */
|
||
|
ec->cfp->pc++;
|
||
|
/* increment PC because source line is calculated with PC-1,
|
||
|
* unless we're not an iseq */
|
||
|
bool treat_pc = ec->cfp->pc;
|
||
|
if (treat_pc) {
|
||
|
ec->cfp->pc++;
|
||
|
}
|
||
|
EXEC_EVENT_HOOK(ec, event, ec->cfp->self, 0, 0, 0, data);
|
||
|
ec->cfp->pc--;
|
||
|
if (treat_pc) {
|
||
|
ec->cfp->pc--;
|
||
|
}
|
||
|
}
|
||
|
#define gc_event_hook_available_p(objspace) ((objspace)->flags.has_hook)
|
||