Skip to content

Commit

Permalink
Fix race on message handler setup
Browse files Browse the repository at this point in the history
  • Loading branch information
0cyn committed Jan 25, 2023
1 parent 1a6f3dd commit 5ce4f94
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Workflow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,6 @@ void Workflow::inlineMethodCalls(AnalysisContextRef ac)
if (GlobalState::viewIsIgnored(bv))
return;

auto messageHandler = GlobalState::messageHandler(bv);

const auto log = BinaryNinja::LogRegistry::GetLogger(PluginLoggerName);

// Ignore the view if it has an unsupported architecture.
Expand Down Expand Up @@ -141,6 +139,8 @@ void Workflow::inlineMethodCalls(AnalysisContextRef ac)
CFStringArchitectureHook* currentHook = new CFStringArchitectureHook(bv->GetDefaultArchitecture());
bv->GetDefaultArchitecture()->Register(currentHook);

auto messageHandler = GlobalState::messageHandler(bv);

try {
auto file = std::make_shared<ObjectiveNinja::BinaryViewFile>(bv);

Expand Down Expand Up @@ -188,6 +188,7 @@ void Workflow::inlineMethodCalls(AnalysisContextRef ac)
GlobalState::storeAnalysisInfo(bv, info);
}
}
auto messageHandler = GlobalState::messageHandler(bv);

if (!messageHandler->hasMessageSendFunctions()) {
log->LogError("Cannot perform Objective-C IL cleanup; no objc_msgSend candidates found");
Expand Down

0 comments on commit 5ce4f94

Please sign in to comment.