mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 22:00:52 +01:00
[PR #405] acphal: AcpHalReleaseShapeContexts takes no argument (RT-ACPHAL-RELEASE) #455
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#455
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/405
Author: @Kokonotcu
Created: 11/24/2026
Status: 🔄 Open
Base:
main← Head:pr/acphal-release-abi📝 Commits (1)
c681f78acphal: AcpHalReleaseShapeContexts takes no argument (RT-ACPHAL-RELEASE)📊 Changes
2 files changed (+14 additions, -14 deletions)
View changed files
📝
runtime/shims/acphal.cpp(+5 -10)📝
runtime/test/acphal_test.cpp(+9 -4)📄 Description
Claim: RT-ACPHAL-RELEASE (#14).
What was wrong. The GDK's
AcpHalReleaseShapeContexts()has no parameter: it frees whatAcpHalAllocateShapeContextsallocated. The shim declared it asAcpHalReleaseShapeContexts(SHAPE_CONTEXTS* ctx = nullptr)and, for a non-nullctx, wrotenullptrinto six array pointers through it. A caller passes nothing, soctxis whatever RCX holds at the call, and six words are written through a stale pointer. In a test that calls it the way the title does (no argument) this showed up as heap corruption,0xc0000374, in about one run in three; in the title the same writes land in its own memory.Change. The function takes no argument and only frees its recorded arrays. The caller's structure stays the caller's to clear.
Test.
acphal_testnow calls it with a stand-in for a stale RCX (a block of0xAAbytes) and checks the block comes back untouched; before this change the six pointer slots in it were zeroed.Tested on Windows 10, i7-11800H, RTX 3080 Laptop (no GPU needed):
acphal_testpasses 10 of 10 repeats under ctest (--repeat until-fail:10), on this branch based onmainece4ba5b3.🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.