summaryrefslogtreecommitdiff
path: root/src/core/arm
diff options
context:
space:
mode:
authorZephyron <zephyron@citron-emu.org>2025-01-18 15:19:45 +1000
committerMike Lothian <mike@fireburn.co.uk>2025-05-11 12:17:03 +0100
commit221efc229415f6fa3ccc08fddc163b00a26e610c (patch)
tree1fa3c4c6c3464e5dbc67637fe49f08dcabbeb764 /src/core/arm
parent07a40fef9c4897ace0f0ed0454e631ae0b561df5 (diff)
memory: Improve null pointer and unmapped memory handling
- Update vcpkg baseline to a42af01b72c28a8e1d7b48107b33e4f286a55ef6 - Add SPIRV-Tools and SPIRV-Headers as submodules - Update Vulkan-related submodules to latest stable versions - Improve memory access error handling: - Add specific handling for null pointer accesses in ARM32 emulation - Return 0 for null pointer reads instead of undefined behavior - Silently ignore writes to null pointers - Add more detailed error messages distinguishing between null pointer access and other unmapped memory errors - Treat addresses below 0x1000 as potential null pointer accesses These changes should provide more graceful handling of null pointer accesses and improve stability when running games that attempt invalid memory operations.
Diffstat (limited to 'src/core/arm')
-rw-r--r--src/core/arm/dynarmic/arm_dynarmic_32.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/core/arm/dynarmic/arm_dynarmic_32.cpp b/src/core/arm/dynarmic/arm_dynarmic_32.cpp
index 65c4ace38..5dc46d777 100644
--- a/src/core/arm/dynarmic/arm_dynarmic_32.cpp
+++ b/src/core/arm/dynarmic/arm_dynarmic_32.cpp
@@ -95,6 +95,13 @@ public:
LOG_CRITICAL(Core_ARM, "Cannot execute instruction at unmapped address {:#08x}", pc);
ReturnException(pc, PrefetchAbort);
return;
+ case Dynarmic::A32::Exception::AccessViolation:
+ if (pc == 0 || pc < 0x1000) {
+ LOG_CRITICAL(Core_ARM, "Null pointer dereference at {:#08x}", pc);
+ ReturnException(pc, DataAbort);
+ return;
+ }
+ [[fallthrough]];
default:
if (m_debugger_enabled) {
ReturnException(pc, InstructionBreakpoint);