fix crash from precompiling out of range funcs, add xexcache version, increment xexcache version (all priors are version 0 thanks to 0 initialization)

This commit is contained in:
chss95cs@gmail.com
2022-11-07 05:40:18 -08:00
parent e21fd22d09
commit 7a17fad88a
4 changed files with 73 additions and 18 deletions

View File

@@ -263,6 +263,12 @@ Function* Processor::ResolveFunction(uint32_t address) {
return nullptr;
}
if (!DemandFunction(function)) {
entry->status = Entry::STATUS_FAILED;
return nullptr;
}
//only add it to the list of resolved functions if resolving succeeded
auto module_for = function->module();
auto xexmod = dynamic_cast<XexModule*>(module_for);
@@ -273,10 +279,6 @@ Function* Processor::ResolveFunction(uint32_t address) {
}
}
if (!DemandFunction(function)) {
entry->status = Entry::STATUS_FAILED;
return nullptr;
}
entry->function = function;
entry->end_address = function->end_address();
status = entry->status = Entry::STATUS_READY;