Skip to content

addrspace: clear the address map when its backing memory is freed - #2546

Open
JoeMatt wants to merge 1 commit into
flyinghead:masterfrom
Provenance-Emu:fix/addrspace-clear-map-on-free
Open

JoeMatt wants to merge 1 commit into
flyinghead:masterfrom
Provenance-Emu:fix/addrspace-clear-map-on-free

Conversation

@JoeMatt

@JoeMatt JoeMatt commented Oct 13, 2026

Copy link
Copy Markdown
Contributor

When nvmem is disabled, termMappings() frees main RAM, VRAM, ARAM and
the Elan RAM but leaves memInfo_ptr unchanged. Each entry still holds
the old host base, so any guest access before the next remap returns a
pointer into freed memory.

Zero the table, as init() does. A null entry routes to handler 0,
readMemNotMapped/writeMemNotMapped, which only log.

Testing: compiles in the libretro core and the standalone build (macOS arm64). Not run on content.

🤖 Generated with Claude Code

When nvmem is disabled, termMappings() frees main RAM, VRAM, ARAM and
the Elan RAM but leaves memInfo_ptr unchanged. Each entry still holds
the old host base, so any guest access before the next remap returns a
pointer into freed memory.

Zero the table, as init() does. A null entry routes to handler 0,
readMemNotMapped/writeMemNotMapped, which only log.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings October 13, 2026 21:58

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

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.

2 participants