about summary refs log tree commit diff homepage
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rwxr-xr-xtools/klee-stats/klee-stats9
1 files changed, 3 insertions, 6 deletions
diff --git a/tools/klee-stats/klee-stats b/tools/klee-stats/klee-stats
index e355f452..a699fb3d 100755
--- a/tools/klee-stats/klee-stats
+++ b/tools/klee-stats/klee-stats
@@ -155,11 +155,6 @@ def select_columns(record, pr):
 
 
 def add_artificial_columns(record):
-    # special case for straight-line code: report 100% branch coverage
-    if "NumBranches" in record and record["NumBranches"] == 0:
-        record["FullBranches"] = 1
-        record["NumBranches"] = 1
-
     # Convert recorded times from microseconds to seconds
     for key in ["UserTime", "WallTime", "QueryTime", "SolverTime", "CexCacheTime", "ForkTime", "ResolveTime"]:
         if not key in record:
@@ -184,7 +179,9 @@ def add_artificial_columns(record):
 
     # Calculate branch coverage
     if "FullBranches" in record and "PartialBranches" in record and "NumBranches" in record:
-        record["BCov"] = 100 * ( 2 * record["FullBranches"] + record["PartialBranches"]) / ( 2 * record["NumBranches"])
+        record["BCov"] = 100.0
+        if record["NumBranches"] != 0:
+            record["BCov"] *= (2 * record["FullBranches"] + record["PartialBranches"]) / (2 * record["NumBranches"])
 
     # Add relative times
     for key in ["SolverTime", "CexCacheTime", "ForkTime", "ResolveTime", "UserTime"]: