Skip to content

Commit fff7be1

Browse files
committed
[BOLT] PointerAuthCFIAnalyzer: return early if there is no work
- makes sure we do not divide by zero, to calculate the % of ignored functions.
1 parent a1e9e33 commit fff7be1

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

bolt/lib/Passes/PointerAuthCFIAnalyzer.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,9 @@ Error PointerAuthCFIAnalyzer::runOnFunctions(BinaryContext &BC) {
137137
return P.second.containedNegateRAState() && !P.second.isIgnored();
138138
});
139139

140+
if (Total == 0)
141+
return Error::success();
142+
140143
ParallelUtilities::runOnEachFunction(
141144
BC, ParallelUtilities::SchedulingPolicy::SP_INST_LINEAR, WorkFun,
142145
SkipPredicate, "PointerAuthCFIAnalyzer");

0 commit comments

Comments
 (0)