mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2026-04-25 15:56:00 +03:00
[PR #3556] [MERGED] Core: Improve memory address validation logic #3570
Labels
No labels
Bloodborne
bug
contributor wanted
documentation
enhancement
frontend
good first issue
help wanted
linux
pull-request
question
release
verification progress
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/shadPS4#3570
Loading…
Add table
Add a link
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/shadps4-emu/shadPS4/pull/3556
Author: @StevenMiller123
Created: 9/8/2025
Status: ✅ Merged
Merged: 9/9/2025
Merged by: @squidbus
Base:
main← Head:vma-map-fix📝 Commits (1)
945bf14Core: Improve memory address validation logic📊 Changes
1 file changed (+28 additions, -17 deletions)
View changed files
📝
src/core/memory.cpp(+28 -17)📄 Description
When I added memory address validation in #2872, I missed that we already had a IsValidAddress function that could be used for ensuring addresses are within our vma map. While it may be slightly slower, IsValidAddress should be more reliable for detecting issues, particularly on Windows platforms where standard library iterators seem to run into a bunch of weird random behavior with these edge cases.
This should make memory asserts more consistent, and in some cases replace some exceptions with memory asserts.
I suspect IsValidAddress isn't fully reliable for Mac platforms, since from what I can tell, it doesn't do any extra checks to handle the address space gaps on that platform. If more rigid checks for dealing with address space gaps is desired, I can add that to this PR.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.