Fix assertion failure when VM_CHECK_MODE
Some VM frames (dummy and top pushed by `rb_vm_call_cfunc`) has iseq but has no pc.
This commit is contained in:
parent
2eec526053
commit
8b162ce9d1
2
gc.c
2
gc.c
@ -1926,7 +1926,7 @@ static void
|
|||||||
gc_event_hook_body(rb_execution_context_t *ec, rb_objspace_t *objspace, const rb_event_flag_t event, VALUE data)
|
gc_event_hook_body(rb_execution_context_t *ec, rb_objspace_t *objspace, const rb_event_flag_t event, VALUE data)
|
||||||
{
|
{
|
||||||
const VALUE *pc = ec->cfp->pc;
|
const VALUE *pc = ec->cfp->pc;
|
||||||
if (VM_FRAME_RUBYFRAME_P(ec->cfp)) {
|
if (pc && VM_FRAME_RUBYFRAME_P(ec->cfp)) {
|
||||||
/* increment PC because source line is calculated with PC-1 */
|
/* increment PC because source line is calculated with PC-1 */
|
||||||
ec->cfp->pc++;
|
ec->cfp->pc++;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user