Commit fa87839
Fix JIT+pystats crash: is_terminator fails for base opcodes
Two bugs when building with --enable-experimental-jit --enable-pystats:
1. `is_terminator()` uses `_PyUop_Uncached[opcode]` to map replicated
variants back to base opcodes, but the array only contains entries
for replicated variants (e.g. `_JUMP_TO_TOP_r00`). For base opcodes
like `_JUMP_TO_TOP` itself, it returns 0, so the terminator is not
recognized. This causes `effective_trace_length()` to hit
`Py_FatalError("No terminating instruction")`.
Fix: fall back to the raw opcode when `_PyUop_Uncached` returns 0.
2. `jit.c` references `jit_got_size` in `OPT_STAT_ADD` but the field
is missing from `OptimizationStats` in `pystats.h`, causing a build
failure.
Fix: add the missing `jit_got_size` field.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent a0c57a8 commit fa87839
2 files changed
+4
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
162 | 162 | | |
163 | 163 | | |
164 | 164 | | |
| 165 | + | |
165 | 166 | | |
166 | 167 | | |
167 | 168 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
602 | 602 | | |
603 | 603 | | |
604 | 604 | | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
605 | 608 | | |
606 | 609 | | |
607 | 610 | | |
| |||
0 commit comments