Repository navigation
Commit 13f3720
committed
Add bytecode_offset=-1 self-enforcing invariant + regression test
Move bytecode_offset=-1 initialization into hir_c_alloc_instr so the
invariant is structurally enforced — even if hir_c_init_instr is
accidentally skipped, bytecode_offset will be -1 (not 0 from calloc).
Add runtime regression test in hir_instr_c_verify.cpp that verifies
the invariant for all three allocation paths (raw alloc, init_instr,
init_deopt). Runs at startup via __attribute__((constructor)).
Addresses gap flagged 5 times (Pythia python#14, python#40, python#59, librarian x2).1 parent 3a1987e commit 13f3720
2 files changed
Lines changed: 42 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
624 | 624 | | |
625 | 625 | | |
626 | 626 | | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
627 | 631 | | |
628 | 632 | | |
629 | 633 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
283 | 283 | | |
284 | 284 | | |
285 | 285 | | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
286 | 323 | | |
287 | 324 | | |
288 | 325 | | |
289 | 326 | | |
| 327 | + | |
290 | 328 | | |
0 commit comments