File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -97,6 +97,10 @@ extern "C"
9797 size_t instructionCount = mlil->GetInstructionCount ();
9898
9999 for (size_t i = 0 ; i < instructionCount; ++i) {
100+ if (i % 100 == 0 && task->IsCancelled ()) {
101+ break ;
102+ }
103+
100104 auto instr = mlil->GetInstruction (i);
101105 if (instr.operation != MLIL_IF)
102106 continue ;
@@ -185,6 +189,10 @@ extern "C"
185189 std::vector<PatchInfo> pendingPatches;
186190
187191 for (size_t i = 0 ; i < mlil->GetInstructionCount (); ++i) {
192+ if (i % 100 == 0 && shouldCancel.load ()) {
193+ break ;
194+ }
195+
188196 auto instr = mlil->GetInstruction (i);
189197 if (instr.operation != MLIL_IF)
190198 continue ;
@@ -204,6 +212,10 @@ extern "C"
204212 }
205213 }
206214
215+ if (shouldCancel.load ()) {
216+ break ;
217+ }
218+
207219 if (pendingPatches.empty ())
208220 break ;
209221
You can’t perform that action at this time.
0 commit comments