CID 1503709: Division or modulo by float zero Closes #4415 --- tester/covoar/ReportsBase.cc | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/tester/covoar/ReportsBase.cc b/tester/covoar/ReportsBase.cc index b4a755c..31dc429 100644 --- a/tester/covoar/ReportsBase.cc +++ b/tester/covoar/ReportsBase.cc @@ -482,9 +482,13 @@ void ReportsBase::WriteSummaryReport( } } - percentage = (double) notExecuted; - percentage /= (double) totalBytes; - percentage *= 100.0; + if (totalBytes == 0) { + percentage = 0; + } else { + percentage = (double) notExecuted; + percentage /= (double) totalBytes; + percentage *= 100.0; + } percentageBranches = (double) ( SymbolsToAnalyze->getNumberBranchesAlwaysTaken(symbolSetName) + -- 1.8.3.1 _______________________________________________ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel