summaryrefslogtreecommitdiff
path: root/view/sharedcache/workflow
diff options
context:
space:
mode:
authorMason Reed <mason@vector35.com>2025-04-02 12:02:24 -0400
committerMason Reed <mason@vector35.com>2025-04-02 12:02:24 -0400
commite2ee6a396a9ff0f6a850b9a648d828a92a73e64e (patch)
tree39e899ee1fbf8b66ef1f5a11469ebf2a3a7f68be /view/sharedcache/workflow
parent1cf326edf3485733b74523bc81827680f8f1bb1f (diff)
[SharedCache] Fix thrown exception in stub function analysis with mismatched expression operation
Diffstat (limited to 'view/sharedcache/workflow')
-rw-r--r--view/sharedcache/workflow/SharedCacheWorkflow.cpp15
1 files changed, 6 insertions, 9 deletions
diff --git a/view/sharedcache/workflow/SharedCacheWorkflow.cpp b/view/sharedcache/workflow/SharedCacheWorkflow.cpp
index 766164b8..8046ed22 100644
--- a/view/sharedcache/workflow/SharedCacheWorkflow.cpp
+++ b/view/sharedcache/workflow/SharedCacheWorkflow.cpp
@@ -156,12 +156,11 @@ void AnalyzeStubFunction(Ref<Function> func, Ref<MediumLevelILFunction> mlil, Sh
// set the variables value.
auto def = mlil->GetSSAVarDefinition(var);
auto defInstr = mlil->GetInstruction(def);
- // TODO: This is 100% not OK, you need to verify the expr operation!
- // targetOffset should be the address from where we load the jump address (i.e. the stub island).
- const auto islandPtr = defInstr.GetSourceExpr().GetSourceExpr().GetConstant();
- loadTarget(islandPtr);
+ if (defInstr.operation != MLIL_SET_VAR_SSA)
+ return;
+ expr = defInstr.GetSourceExpr<MLIL_SET_VAR_SSA>();
+ // Fallthrough to load ptr.
}
- break;
case MLIL_LOAD_SSA:
expr = expr.GetSourceExpr<MLIL_LOAD_SSA>();
if (expr.operation != MLIL_CONST_PTR)
@@ -330,10 +329,8 @@ void SharedCacheWorkflow::Register()
// Register and insert activities here.
ObjCActivity::Register(*workflow);
- workflow->RegisterActivity(new Activity("core.analysis.sharedCache.processStubFunction", &AnalyzeFunction));
- std::vector<std::string> inserted = {
- "core.analysis.sharedCache.processStubFunction"
- };
+ workflow->RegisterActivity(new Activity("core.analysis.sharedCache.analysis", &AnalyzeFunction));
+ std::vector<std::string> inserted = { "core.analysis.sharedCache.analysis" };
workflow->Insert("core.function.analyzeTailCalls", inserted);
static constexpr auto WORKFLOW_DESCRIPTION = R"({