Skip to content

Commit 5ce4f94

Browse files
committed
Fix race on message handler setup
1 parent 1a6f3dd commit 5ce4f94

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Workflow.cpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,6 @@ void Workflow::inlineMethodCalls(AnalysisContextRef ac)
105105
if (GlobalState::viewIsIgnored(bv))
106106
return;
107107

108-
auto messageHandler = GlobalState::messageHandler(bv);
109-
110108
const auto log = BinaryNinja::LogRegistry::GetLogger(PluginLoggerName);
111109

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

142+
auto messageHandler = GlobalState::messageHandler(bv);
143+
144144
try {
145145
auto file = std::make_shared<ObjectiveNinja::BinaryViewFile>(bv);
146146

@@ -188,6 +188,7 @@ void Workflow::inlineMethodCalls(AnalysisContextRef ac)
188188
GlobalState::storeAnalysisInfo(bv, info);
189189
}
190190
}
191+
auto messageHandler = GlobalState::messageHandler(bv);
191192

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

0 commit comments

Comments
 (0)