summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Wu <XrXr@users.noreply.github.com>2025-12-03 15:05:01 -0500
committerAlan Wu <XrXr@users.noreply.github.com>2025-12-05 15:49:25 -0500
commit02ca507aa3fe45640ace494e5440d9e8bfd5a517 (patch)
treec86ee4262a09ccf50f473989ca97fb943992f12e
parent7ecd369a87d65879f98d95d726772238c1dabc16 (diff)
JITs: rb_iseq_opcode_at_pc(): Accommodate switch-case interpreter
-rw-r--r--jit.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/jit.c b/jit.c
index a886b66278..ae592b2205 100644
--- a/jit.c
+++ b/jit.c
@@ -52,8 +52,11 @@ rb_iseq_pc_at_idx(const rb_iseq_t *iseq, uint32_t insn_idx)
int
rb_iseq_opcode_at_pc(const rb_iseq_t *iseq, const VALUE *pc)
{
- // YJIT should only use iseqs after AST to bytecode compilation
- RUBY_ASSERT_ALWAYS(FL_TEST_RAW((VALUE)iseq, ISEQ_TRANSLATED));
+ // YJIT should only use iseqs after AST to bytecode compilation.
+ // (Certain non-default interpreter configurations never set ISEQ_TRANSLATED)
+ if (OPT_DIRECT_THREADED_CODE || OPT_CALL_THREADED_CODE) {
+ RUBY_ASSERT_ALWAYS(FL_TEST_RAW((VALUE)iseq, ISEQ_TRANSLATED));
+ }
const VALUE at_pc = *pc;
return rb_vm_insn_addr2opcode((const void *)at_pc);