mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-01-13 19:32:41 +00:00
ScopDetection: Make sure we do not accidentally divide by zero
This code path is likely never triggered, but by still handling this case locally we avoid warnings in clangs static analyzer. llvm-svn: 280939
This commit is contained in:
parent
adfc971820
commit
b316dc166f
@ -1307,6 +1307,9 @@ bool ScopDetection::hasSufficientCompute(DetectionContext &Context,
|
||||
int NumLoops) const {
|
||||
int InstCount = 0;
|
||||
|
||||
if (NumLoops == 0)
|
||||
return false;
|
||||
|
||||
for (auto *BB : Context.CurRegion.blocks())
|
||||
if (Context.CurRegion.contains(LI->getLoopFor(BB)))
|
||||
InstCount += BB->size();
|
||||
|
Loading…
x
Reference in New Issue
Block a user