summaryrefslogtreecommitdiff
path: root/gc.c
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2019-08-01 20:08:22 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2019-08-01 20:55:03 +0900
commit8b162ce9d1003e4e469d8f48cb9a2076fd45b47c (patch)
treeb22c29bc6c9f188d457ac83ace21cd57bfba3b59 /gc.c
parent2eec526053186f05e8b73003d5212c871724a309 (diff)
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.
Diffstat (limited to 'gc.c')
-rw-r--r--gc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gc.c b/gc.c
index fd30c75618..fb8fa53911 100644
--- a/gc.c
+++ b/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)
{
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 */
ec->cfp->pc++;
}