Skip to content

InstallNetProbe: card.resource stubs list every scratch register the call may destroy (#70, C of 3) - #73

Merged
tinic merged 1 commit into
mainfrom
fix/lvo-clobber-installnetprobe
Sep 26, 2026
Merged

tinic merged 1 commit into
mainfrom
fix/lvo-clobber-installnetprobe

Conversation

@tinic

@tinic tinic commented Sep 26, 2026

Copy link
Copy Markdown
Owner

Part of #70, shipped-site fixes, PR C of 3: src/tools/installnetprobe.c → InstallNetProbe. Independent of #71 (merged) and #72.

The three card.resource stubs (OwnCard -6, ReleaseCard -12, CopyTuple -72) passed their argument registers as asm inputs only.

REAL today (main 66e0bf5), owned-card path:

968 lea 0x18,a1       ; &handle
96e jsr -6(a6)        ; OwnCard
980 movea.l 0x7c,a6
986 lea 74(sp),a0     ; a1 NOT reloaded
98a moveq #32,d1
98c moveq #6,d0
98e jsr -72(a6)       ; CopyTuple(0x20) with whatever OwnCard left in a1

After:

980 movea.l 0x7c,a6
986 lea 0x18,a1       ; handle reloaded
98c lea 74(sp),a0
990 moveq #32,d1
992 moveq #6,d0

Change: each argument register becomes a "+r" operand, with a comment at the stubs and a one-line CHANGELOG entry.

Proof:

With #71 and #72 this closes all 16 shipped sites in #70.

🤖 Generated with Claude Code

…call may destroy

installnetprobe.c's three card.resource stubs (OwnCard, ReleaseCard,
CopyTuple) passed their argument registers as asm inputs only. The
library ABI lets every LVO destroy d0/d1/a0/a1.

This was REAL at main 66e0bf5. probe_own_card loads a1 = &handle
(0x968) for OwnCard (jsr -6 at 0x96e). On the owned path, the first
CopyTuple(0x20) (jsr -72 at 0x98e) was issued without reloading a1, so it
used whatever OwnCard left there. After the change, 0x986 is
`lea 0x18,a1` before the CopyTuple, which reloads the handle. The other
two stubs were latent.

Each argument register is now a "+r" operand; unused scratch registers
remain clobbers. The #70 scanner no longer flags installnetprobe.c. With
#71 and #72 this closes the 16 shipped sites in #70.

Part of #70 (shipped sites, PR C of 3).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@tinic
tinic merged commit ef4fb4b into main Sep 26, 2026
41 of 42 checks passed
@tinic
tinic deleted the fix/lvo-clobber-installnetprobe branch September 26, 2026 02:43
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