Commit 28178f4
committed
W22: bounds-check nextInstr() in YIELD_VALUE pattern-deopt
Fixes regression in bffec89 where bci.nextInstr() was called on the
final YIELD_VALUE bytecode without bounds-checking, producing a
BytecodeInstruction that points past co_code. Reading .opcode() /
.oparg() on that invalid instruction SIGSEGVs.
Per Python/jit/bytecode.h:57 contract: nextInstrOffset() will go past
the end of the instruction stream for the last instruction. Match the
existing pattern at builder.cpp:1143 (BCOffset comparison against
bc_block.size()) before dereferencing the next instruction.
Catch credit: testkeeper 14:34:52Z controlled experiment showed
auto-compile of asyncio internals (which contain YIELD_VALUE near
end-of-bytecode) SIGSEGV'd at iter 1000 (auto-compile threshold),
while pre-bffec89650 binary at the same tree exited cleanly. The
dis.dis fixture verification at bffec89 commit-time only exercised
small functions where YIELD_VALUE was never the last instruction —
real production codepaths exposed the boundary case.
Updates the author-attribution comment to use timestamp citations
(per supervisor 14:30:40Z discipline correction post medic catch on
shepard 14:29:14Z directive).1 parent bffec89 commit 28178f4
1 file changed
Lines changed: 23 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4899 | 4899 | | |
4900 | 4900 | | |
4901 | 4901 | | |
4902 | | - | |
| 4902 | + | |
| 4903 | + | |
4903 | 4904 | | |
4904 | 4905 | | |
4905 | 4906 | | |
| |||
4938 | 4939 | | |
4939 | 4940 | | |
4940 | 4941 | | |
4941 | | - | |
4942 | | - | |
4943 | | - | |
4944 | | - | |
4945 | | - | |
4946 | | - | |
4947 | | - | |
4948 | | - | |
4949 | | - | |
4950 | | - | |
4951 | | - | |
| 4942 | + | |
| 4943 | + | |
| 4944 | + | |
| 4945 | + | |
| 4946 | + | |
| 4947 | + | |
| 4948 | + | |
| 4949 | + | |
| 4950 | + | |
| 4951 | + | |
| 4952 | + | |
| 4953 | + | |
| 4954 | + | |
| 4955 | + | |
| 4956 | + | |
| 4957 | + | |
| 4958 | + | |
| 4959 | + | |
| 4960 | + | |
| 4961 | + | |
| 4962 | + | |
4952 | 4963 | | |
4953 | 4964 | | |
4954 | 4965 | | |
| |||
0 commit comments