Skip to content

Commit 1a294db

Browse files
committed
Add more fiushed to be safe
1 parent 558b7fa commit 1a294db

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

source/function_patcher.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@ bool PatchFunction(std::shared_ptr<PatchedFunctionData> &patchedFunction) {
6363
return false;
6464
}
6565

66+
DCFlushRange(gJumpHeapData, JUMP_HEAP_DATA_SIZE);
67+
ICInvalidateRange(gJumpHeapData, JUMP_HEAP_DATA_SIZE);
68+
6669
if (patchedFunction->functionName) {
6770
DEBUG_FUNCTION_LINE("Patching function %s...", patchedFunction->functionName->c_str());
6871
} else {
@@ -85,6 +88,9 @@ bool PatchFunction(std::shared_ptr<PatchedFunctionData> &patchedFunction) {
8588
// Write this->replaceWithInstruction to the first instruction of the function we want to replace.
8689
CThread::runOnAllCores(writeDataAndFlushIC, patchedFunction.get());
8790

91+
DCFlushRange(gJumpHeapData, JUMP_HEAP_DATA_SIZE);
92+
ICInvalidateRange(gJumpHeapData, JUMP_HEAP_DATA_SIZE);
93+
8894
// Set patch status
8995
patchedFunction->isPatched = true;
9096

0 commit comments

Comments
 (0)