aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Cpu/MemoryManager.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Ryujinx.Cpu/MemoryManager.cs')
-rw-r--r--Ryujinx.Cpu/MemoryManager.cs2
1 files changed, 1 insertions, 1 deletions
diff --git a/Ryujinx.Cpu/MemoryManager.cs b/Ryujinx.Cpu/MemoryManager.cs
index 83c288ae..59654e8b 100644
--- a/Ryujinx.Cpu/MemoryManager.cs
+++ b/Ryujinx.Cpu/MemoryManager.cs
@@ -627,7 +627,7 @@ namespace Ryujinx.Cpu
{
pte = Volatile.Read(ref pageRef);
}
- while (Interlocked.CompareExchange(ref pageRef, (pte & invTagMask) | tag, pte) != pte);
+ while (pte != 0 && Interlocked.CompareExchange(ref pageRef, (pte & invTagMask) | tag, pte) != pte);
pageStart++;
}