@@ -56,19 +56,19 @@ static bool GetNextFunctionAfterAddress(Ref<BinaryView> data, Ref<Platform> plat
5656}
5757
5858
59- void Architecture::DefaultAnalyzeBasicBlocks (Function& function, BNBasicBlockAnalysisContext* context)
59+ void Architecture::DefaultAnalyzeBasicBlocks (Function& function, BasicBlockAnalysisContext& context)
6060{
6161 auto data = function.GetView ();
6262 queue<ArchAndAddr> blocksToProcess;
6363 map<ArchAndAddr, Ref<BasicBlock>> instrBlocks;
6464 set<ArchAndAddr> seenBlocks;
6565 map<ArchAndAddr, set<ArchAndAddr>> indirectBranches;
66- for (size_t i = 0 ; i < context-> indirectBranchesCount ; i++)
66+ for (size_t i = 0 ; i < context. indirectBranchesCount ; i++)
6767 {
68- auto sourceLocation = ArchAndAddr (new CoreArchitecture (context-> indirectBranches [i].sourceArch ),
69- context-> indirectBranches [i].sourceAddr );
70- auto destLocation = ArchAndAddr (new CoreArchitecture (context-> indirectBranches [i].destArch ),
71- context-> indirectBranches [i].destAddr );
68+ auto sourceLocation = ArchAndAddr (new CoreArchitecture (context. indirectBranches [i].sourceArch ),
69+ context. indirectBranches [i].sourceAddr );
70+ auto destLocation = ArchAndAddr (new CoreArchitecture (context. indirectBranches [i].destArch ),
71+ context. indirectBranches [i].destAddr );
7272 indirectBranches[sourceLocation].insert (destLocation);
7373 }
7474
@@ -148,7 +148,7 @@ void Architecture::DefaultAnalyzeBasicBlocks(Function& function, BNBasicBlockAna
148148 }
149149
150150 uint64_t totalSize = 0 ;
151- uint64_t maxSize = context-> maxFunctionSize ;
151+ uint64_t maxSize = context. maxFunctionSize ;
152152 while (blocksToProcess.size () != 0 )
153153 {
154154 if (data->AnalysisIsAborted ())
@@ -356,7 +356,7 @@ void Architecture::DefaultAnalyzeBasicBlocks(Function& function, BNBasicBlockAna
356356 function.AddDirectCodeReference (location, info.branchTarget [i]);
357357
358358 auto otherFunc = function.GetCalleeForAnalysis (targetPlatform, target.address , true );
359- if (context-> translateTailCalls && targetPlatform && otherFunc && (otherFunc->GetStart () != function.GetStart ()))
359+ if (context. translateTailCalls && targetPlatform && otherFunc && (otherFunc->GetStart () != function.GetStart ()))
360360 {
361361 calledFunctions.insert (otherFunc);
362362 if (info.branchType [i] == UnconditionalBranch)
@@ -371,7 +371,7 @@ void Architecture::DefaultAnalyzeBasicBlocks(Function& function, BNBasicBlockAna
371371 break ;
372372 }
373373 }
374- else if (context-> disallowBranchToString && data->GetStringAtAddress (location.address , strRef) && targetExceedsByteLimit (strRef))
374+ else if (context. disallowBranchToString && data->GetStringAtAddress (location.address , strRef) && targetExceedsByteLimit (strRef))
375375 {
376376 BNLogInfo (" Not adding branch target from 0x%" PRIx64 " to string at 0x%" PRIx64
377377 " length:%zu" ,
@@ -503,7 +503,7 @@ void Architecture::DefaultAnalyzeBasicBlocks(Function& function, BNBasicBlockAna
503503 targetPlatform = funcPlatform->GetRelatedPlatform (branch.arch );
504504
505505 // Normal analysis should not inline indirect targets that are function starts
506- if (context-> translateTailCalls && data->GetAnalysisFunction (targetPlatform, branch.address ))
506+ if (context. translateTailCalls && data->GetAnalysisFunction (targetPlatform, branch.address ))
507507 continue ;
508508
509509 block->AddPendingOutgoingEdge (IndirectBranch, branch.address , branch.arch );
@@ -590,10 +590,10 @@ void Architecture::DefaultAnalyzeBasicBlocks(Function& function, BNBasicBlockAna
590590 // We prefer to allow disassembly when function analysis is disabled, but only up to the maximum size.
591591 // The log message and tag are generated in ProcessAnalysisSkip
592592 totalSize += info.length ;
593- if (context-> analysisSkipOverride == NeverSkipFunctionAnalysis)
593+ if (context. analysisSkipOverride == NeverSkipFunctionAnalysis)
594594 maxSize = 0 ;
595- else if (!maxSize && (context-> analysisSkipOverride == AlwaysSkipFunctionAnalysis))
596- maxSize = context-> maxFunctionSize ;
595+ else if (!maxSize && (context. analysisSkipOverride == AlwaysSkipFunctionAnalysis))
596+ maxSize = context. maxFunctionSize ;
597597 if (maxSize && (totalSize > maxSize))
598598 break ;
599599
@@ -609,7 +609,7 @@ void Architecture::DefaultAnalyzeBasicBlocks(Function& function, BNBasicBlockAna
609609 delayInstructionEndsBlock = endsBlock;
610610 }
611611
612- if (block->CanExit () && context-> translateTailCalls && !delaySlotCount && hasNextFunc && (location.address == nextFuncAddr))
612+ if (block->CanExit () && context. translateTailCalls && !delaySlotCount && hasNextFunc && (location.address == nextFuncAddr))
613613 {
614614 // Falling through into another function. Don't consider this a tail call if the current block
615615 // called the function, as this indicates a get PC construct.
@@ -644,5 +644,5 @@ void Architecture::DefaultAnalyzeBasicBlocks(Function& function, BNBasicBlockAna
644644void Architecture::DefaultAnalyzeBasicBlocksCallback (BNFunction* function, BNBasicBlockAnalysisContext* context)
645645{
646646 Ref<Function> func (new Function (BNNewFunctionReference (function)));
647- Architecture::DefaultAnalyzeBasicBlocks (*func, context);
647+ Architecture::DefaultAnalyzeBasicBlocks (*func, * context);
648648}
0 commit comments