Implement a better way to combat Clang's unsafe code reordering.

This commit is contained in:
Skyth
2024-11-17 21:00:36 +03:00
parent a7c970d324
commit d8676283fd
2 changed files with 8 additions and 11 deletions

View File

@@ -2265,9 +2265,6 @@ bool Recompiler::Recompile(const Function& fn)
{
println("loc_{:X}:", base);
// With a read barrier we prevent the compiler from doing unsafe code reordering. I wonder if we could do this better...
println("\t_ReadBarrier();");
// Anyone could jump to this label so we wouldn't know what the CSR state would be.
csrState = CSRState::Unknown;
}