Skip to content

Commit 092cd4c

Browse files
LipenCaelmBleidd
authored andcommitted
Fix
1 parent 2505a7b commit 092cd4c

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

usvm-ts/src/main/kotlin/org/usvm/api/checkers/UnreachableCodeDetector.kt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,13 @@ class UnreachableCodeDetector : TsInterpreterObserver, UMachineObserver<TsState>
4040
}
4141

4242
override fun onMachineStopped() {
43-
result = uncoveredIfSuccessors.map { (method, values) ->
44-
val visitedIfs = visitedIfStmt.getValue(method)
45-
val values = values.groupBy { method.cfg.predecessors(it).single() }
43+
result = uncoveredIfSuccessors.mapNotNull { (method, values) ->
44+
val visitedIfs = visitedIfStmt[method] ?: return@mapNotNull null
45+
val grouped = values.groupBy { method.cfg.predecessors(it).single() }
4646
.map { it.key as EtsIfStmt to it.value.toSet() }
4747
.filter { it.first in visitedIfs }
4848
.toSet()
49-
method to values
49+
method to grouped
5050
}.toMap()
5151
}
52-
}
52+
}

0 commit comments

Comments
 (0)