From 527cc7328207de06750debf4c6bfce81a897957d Mon Sep 17 00:00:00 2001 From: Takashi Kokubun Date: Mon, 23 Dec 2024 14:12:08 -0800 Subject: [PATCH] YJIT: Return None if entry block compilation fails (#12445) --- yjit/src/core.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/yjit/src/core.rs b/yjit/src/core.rs index d81dd60f0b..22ad322cc0 100644 --- a/yjit/src/core.rs +++ b/yjit/src/core.rs @@ -3366,8 +3366,9 @@ fn entry_stub_hit_body( get_or_create_iseq_payload(iseq).entries.push(pending_entry.into_entry()); } - // Let the stub jump to the entry to load entry registers - Some(next_entry.raw_ptr(cb)) + // Return a code pointer if the block is successfully compiled. The entry stub needs + // to jump to the entry preceding the block to load the registers in reg_mapping. + blockref.map(|_block| next_entry.raw_ptr(cb)) } /// Generate a stub that calls entry_stub_hit