mirror of
https://github.com/libretro/ppsspp.git
synced 2024-11-25 01:00:01 +00:00
Actually clear the hash->func map on forget.
Better not to have dangling pointers.
This commit is contained in:
parent
10bcb323ac
commit
014445655d
@ -1040,6 +1040,7 @@ skip:
|
||||
|
||||
// Most of the time, functions from the same module will be contiguous in functions.
|
||||
FunctionsVector::iterator prevMatch = functions.end();
|
||||
size_t originalSize = functions.size();
|
||||
for (auto iter = functions.begin(); iter != functions.end(); ++iter) {
|
||||
const bool hadPrevMatch = prevMatch != functions.end();
|
||||
const bool match = iter->start >= startAddr && iter->start <= endAddr;
|
||||
@ -1060,8 +1061,11 @@ skip:
|
||||
|
||||
RestoreReplacedInstructions(startAddr, endAddr);
|
||||
|
||||
// TODO: Also wipe them from hash->function map.
|
||||
// It should be fine not to though, since a collision is not likely.
|
||||
if (functions.empty()) {
|
||||
hashToFunction.clear();
|
||||
} else if (originalSize != functions.size()) {
|
||||
UpdateHashToFunctionMap();
|
||||
}
|
||||
}
|
||||
|
||||
void ReplaceFunctions() {
|
||||
|
Loading…
Reference in New Issue
Block a user