diff options
| author | Alan Wu <XrXr@users.noreply.github.com> | 2025-12-03 15:05:01 -0500 |
|---|---|---|
| committer | Alan Wu <XrXr@users.noreply.github.com> | 2025-12-05 15:49:25 -0500 |
| commit | 02ca507aa3fe45640ace494e5440d9e8bfd5a517 (patch) | |
| tree | c86ee4262a09ccf50f473989ca97fb943992f12e | |
| parent | 7ecd369a87d65879f98d95d726772238c1dabc16 (diff) | |
JITs: rb_iseq_opcode_at_pc(): Accommodate switch-case interpreter
| -rw-r--r-- | jit.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -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); |
