Skip to content

fix(lint): use the approved GcHeader accessor in the inline-slot-floor probe - #7976

Merged
proggeramlug merged 1 commit into
mainfrom
fix/lint-red-gcheader-cast
Aug 12, 2026
Merged

fix(lint): use the approved GcHeader accessor in the inline-slot-floor probe#7976
proggeramlug merged 1 commit into
mainfrom
fix/lint-red-gcheader-cast

Conversation

@proggeramlug

Copy link
Copy Markdown
Contributor

lint is red on mainscripts/addr_class_inventory.py exits 1 on one violation introduced by #7928:

crates/perry-runtime/src/object/tests.rs:646: [gcheader-cast] let gc = (obj as *const u8).sub(crate::gc::GC_HEADER_SIZE) as *const crate::gc::GcHeader;

Verified by running the checker in a clean worktree at origin/main (my own working tree is on another branch, which is why a local run initially passed and nearly had me dismiss the report).

Fix: use addr_class::try_read_gc_header, the accessor the checker's own error message names. It takes the object address and does the - GC_HEADER_SIZE arithmetic itself, behind its plausibility and small-slab checks — so the probe also stops assuming a header is present rather than asserting it.

No allowlist entry added. The ratchet exists so a fix deletes the violation; exempting it would be the thing the file's own README says not to do.

Why this matters beyond one line

A required context that is red means every merge bypasses it, and a genuinely new violation lands invisibly behind the stale one. That is CLAUDE.md's documented failure mode, and it was live: ~20 PRs merged into the collector today with admin bypass.

Validation

  • python3 scripts/addr_class_inventory.pypasses (1056 files scanned, 284 allowlisted, 546 ratcheted sites); fails on origin/main.
  • cargo check -p perry-runtime --lib --tests — 0 errors.
  • cargo fmt --all -- --check — clean.

Found by the #7955/#7956 agent while validating #7974.

@proggeramlug
proggeramlug merged commit a9f55ad into main Aug 12, 2026
8 of 52 checks passed
@proggeramlug
proggeramlug deleted the fix/lint-red-gcheader-cast branch August 12, 2026 16:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant