Skip to content

Commit dc4e426

Browse files
committed
sound/unsound stat
1 parent ca8cf39 commit dc4e426

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

scripts/python/examine_statistics.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ def calculate_statistics(file_path):
1212
edges = 0
1313
time_millis = 0
1414
rows = 0
15+
unsound = 0
1516

1617
with open(file_path, newline='') as csvfile:
1718
reader = csv.reader(csvfile)
@@ -28,6 +29,8 @@ def calculate_statistics(file_path):
2829
time_millis_index = header.index(" Time (millis)")
2930

3031
for row in reader:
32+
if int(row[unknown_jumps_index]) > 0:
33+
unsound += 1
3134
rows += 1
3235
total_opcodes += int(row[total_opcodes_index])
3336
total_jumps += int(row[total_jumps_index])
@@ -50,6 +53,7 @@ def calculate_statistics(file_path):
5053
print(f"Erroneous jumps: {erroneous_jumps} ({percentuale(erroneous_jumps,total_jumps)}%)")
5154
print(f"Total jumps with classification: {classified} ({'match' if classified == total_jumps else 'mismatch'})")
5255
print(f"Edges: {edges}")
56+
print(f"Unsound CFGs (only if linking was disabled): {unsound}")
5357
print(f"Average Time (seconds): {avg_time_millis / 1000}")
5458

5559
def percentuale(num, den):

0 commit comments

Comments
 (0)