diff options
| author | Ryan Houdek <Sonicadvance1@gmail.com> | 2015-08-28 14:36:14 -0500 |
|---|---|---|
| committer | Ryan Houdek <Sonicadvance1@gmail.com> | 2015-08-28 14:36:14 -0500 |
| commit | 2c3fa8da288878f0664499997cd503de06b71e80 (patch) | |
| tree | 246dc9719ff97661f563b9cc367d29d4a76194e8 /Source/Core | |
| parent | a6bd2fea28a82ed156c53b6da6f8db5ca3dce857 (diff) | |
[AArch64] Fix a bug in the register caches.
This is a bug that crops if BindToRegister() is called multiple times in a row without a R() function call between them.
How to reproduce the bug:
1) Have a completely filled cache with no host register remaining
2) Call BindToRegister() with different guest registers
3) Don't call R() between the BindToRegister() calls.
This issue typically wouldn't be seen for a couple of reasons. Typically we have /plenty/ of registers in the cache, and in most cases we only call
BindToRegister() once per instruction. In the off chance that it is called multiple times, it wouldn't update the last used counts and would flush the
same register as the previous call to it.
Diffstat (limited to 'Source/Core')
| -rw-r--r-- | Source/Core/Core/PowerPC/JitArm64/JitArm64_RegCache.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Source/Core/Core/PowerPC/JitArm64/JitArm64_RegCache.cpp b/Source/Core/Core/PowerPC/JitArm64/JitArm64_RegCache.cpp index 27b021cf8a..c58a3cee46 100644 --- a/Source/Core/Core/PowerPC/JitArm64/JitArm64_RegCache.cpp +++ b/Source/Core/Core/PowerPC/JitArm64/JitArm64_RegCache.cpp @@ -206,6 +206,8 @@ void Arm64GPRCache::BindToRegister(u32 preg, bool do_load) { OpArg& reg = m_guest_registers[preg]; + reg.ResetLastUsed(); + reg.SetDirty(true); if (reg.GetType() == REG_NOTLOADED) { @@ -331,6 +333,9 @@ void Arm64FPRCache::BindToRegister(u32 preg, bool do_load, bool only_lower) OpArg& reg = m_guest_registers[preg]; bool was_dirty = reg.IsDirty(); + + reg.ResetLastUsed(); + reg.SetDirty(true); switch (reg.GetType()) { |
