Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions source/function_patcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ bool PatchFunction(std::shared_ptr<PatchedFunctionData> &patchedFunction) {
return false;
}

DCFlushRange(gJumpHeapData, JUMP_HEAP_DATA_SIZE);
ICInvalidateRange(gJumpHeapData, JUMP_HEAP_DATA_SIZE);

if (patchedFunction->functionName) {
DEBUG_FUNCTION_LINE("Patching function %s...", patchedFunction->functionName->c_str());
} else {
Expand All @@ -85,6 +88,9 @@ bool PatchFunction(std::shared_ptr<PatchedFunctionData> &patchedFunction) {
// Write this->replaceWithInstruction to the first instruction of the function we want to replace.
CThread::runOnAllCores(writeDataAndFlushIC, patchedFunction.get());

DCFlushRange(gJumpHeapData, JUMP_HEAP_DATA_SIZE);
ICInvalidateRange(gJumpHeapData, JUMP_HEAP_DATA_SIZE);

// Set patch status
patchedFunction->isPatched = true;

Expand Down