Commit 66fc330
Yogthos
Pin the top_dyns offset with a test, drop the duplicate extern
The fix rests on top_dyns sitting at offset 8 of a struct that is private
to janet.c, and janetrs depends on evil-janet "1", so a cargo update can
move it. A wrong offset wouldn't fail the build — it would hand
janet_gcroot whatever now lives there. The stress harness can't catch
that: it's #[ignore]d and needs the user's plugin dir, so CI had no
coverage of the fix at all.
top_dyns_offset_is_stable runs in the normal suite on a bare VM of its
own. It leans on the null-before-first-setdyn transition to discriminate
the field (abstract_registry is already non-null after janet_init;
core_env stays null and never gains dyn entries), then checks the entry
count and that janet_dyn reads the same table. Verified it fails when a
field is inserted ahead of top_dyns.
Also use the janet_local_vm already in the bindings instead of
re-declaring it. Two extern declarations of one symbol with different
return types only compiled because they sit in different crates, so
clashing_extern_declarations never fired. The pointer read moves into
top_dyns_ptr, which is what the test drives.1 parent a4346e5 commit 66fc330
2 files changed
Lines changed: 120 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3519 | 3519 | | |
3520 | 3520 | | |
3521 | 3521 | | |
| 3522 | + | |
| 3523 | + | |
| 3524 | + | |
| 3525 | + | |
| 3526 | + | |
| 3527 | + | |
| 3528 | + | |
| 3529 | + | |
| 3530 | + | |
| 3531 | + | |
| 3532 | + | |
| 3533 | + | |
| 3534 | + | |
| 3535 | + | |
| 3536 | + | |
| 3537 | + | |
| 3538 | + | |
| 3539 | + | |
| 3540 | + | |
| 3541 | + | |
| 3542 | + | |
| 3543 | + | |
| 3544 | + | |
| 3545 | + | |
| 3546 | + | |
| 3547 | + | |
| 3548 | + | |
| 3549 | + | |
| 3550 | + | |
| 3551 | + | |
| 3552 | + | |
| 3553 | + | |
| 3554 | + | |
| 3555 | + | |
| 3556 | + | |
| 3557 | + | |
| 3558 | + | |
| 3559 | + | |
| 3560 | + | |
| 3561 | + | |
| 3562 | + | |
| 3563 | + | |
| 3564 | + | |
| 3565 | + | |
| 3566 | + | |
| 3567 | + | |
| 3568 | + | |
| 3569 | + | |
| 3570 | + | |
| 3571 | + | |
| 3572 | + | |
| 3573 | + | |
| 3574 | + | |
| 3575 | + | |
| 3576 | + | |
| 3577 | + | |
| 3578 | + | |
| 3579 | + | |
| 3580 | + | |
| 3581 | + | |
| 3582 | + | |
| 3583 | + | |
| 3584 | + | |
| 3585 | + | |
| 3586 | + | |
| 3587 | + | |
| 3588 | + | |
| 3589 | + | |
| 3590 | + | |
| 3591 | + | |
| 3592 | + | |
| 3593 | + | |
| 3594 | + | |
| 3595 | + | |
| 3596 | + | |
| 3597 | + | |
| 3598 | + | |
| 3599 | + | |
| 3600 | + | |
| 3601 | + | |
| 3602 | + | |
| 3603 | + | |
| 3604 | + | |
| 3605 | + | |
| 3606 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2192 | 2192 | | |
2193 | 2193 | | |
2194 | 2194 | | |
2195 | | - | |
2196 | | - | |
2197 | | - | |
2198 | | - | |
| 2195 | + | |
| 2196 | + | |
| 2197 | + | |
| 2198 | + | |
| 2199 | + | |
| 2200 | + | |
| 2201 | + | |
| 2202 | + | |
| 2203 | + | |
| 2204 | + | |
| 2205 | + | |
2199 | 2206 | | |
2200 | 2207 | | |
2201 | 2208 | | |
| 2209 | + | |
2202 | 2210 | | |
2203 | 2211 | | |
2204 | 2212 | | |
2205 | 2213 | | |
| 2214 | + | |
| 2215 | + | |
| 2216 | + | |
| 2217 | + | |
2206 | 2218 | | |
2207 | | - | |
2208 | | - | |
| 2219 | + | |
| 2220 | + | |
| 2221 | + | |
| 2222 | + | |
| 2223 | + | |
| 2224 | + | |
| 2225 | + | |
| 2226 | + | |
2209 | 2227 | | |
2210 | 2228 | | |
2211 | 2229 | | |
| |||
2247 | 2265 | | |
2248 | 2266 | | |
2249 | 2267 | | |
2250 | | - | |
2251 | | - | |
2252 | | - | |
| 2268 | + | |
| 2269 | + | |
| 2270 | + | |
| 2271 | + | |
| 2272 | + | |
| 2273 | + | |
| 2274 | + | |
| 2275 | + | |
| 2276 | + | |
| 2277 | + | |
| 2278 | + | |
2253 | 2279 | | |
2254 | 2280 | | |
2255 | 2281 | | |
| |||
0 commit comments