Skip to content

Commit a7f8a6e

Browse files
committed
Style fixes
1 parent e4b01b5 commit a7f8a6e

File tree

3 files changed

+67
-10
lines changed

3 files changed

+67
-10
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ class UnreachableCodeDetector : TsInterpreterObserver, UMachineObserver<TsState>
4343
uncoveredIfSuccessors
4444
.filter { it.value.isNotEmpty() }
4545
.takeIf { it.isNotEmpty() }
46-
?.let { method to it.map { UncoveredIfSuccessors(it.key, it.value) } }
46+
?.let { ifSucc -> method to ifSucc.map { UncoveredIfSuccessors(it.key, it.value) } }
4747
}.toMap()
4848
}
4949
}

usvm-ts/src/main/kotlin/org/usvm/machine/TsInterpreterObserver.kt

Lines changed: 66 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,72 @@ import org.usvm.statistics.UInterpreterObserver
1414

1515
@Suppress("unused")
1616
interface TsInterpreterObserver : UInterpreterObserver {
17-
fun onAssignStatement(simpleValueResolver: TsSimpleValueResolver, stmt: EtsAssignStmt, scope: TsStepScope) {}
17+
fun onAssignStatement(
18+
simpleValueResolver: TsSimpleValueResolver,
19+
stmt: EtsAssignStmt,
20+
scope: TsStepScope
21+
) {
22+
// default empty implementation
23+
}
24+
1825
// TODO on entry point
19-
fun onCallWithUnresolvedArguments(simpleValueResolver: TsSimpleValueResolver, stmt: EtsCallExpr, scope: TsStepScope) {}
26+
27+
fun onCallWithUnresolvedArguments(
28+
simpleValueResolver: TsSimpleValueResolver,
29+
stmt: EtsCallExpr,
30+
scope: TsStepScope
31+
) {
32+
// default empty implementation
33+
}
34+
2035
// TODO onCallWithResolvedArguments
21-
fun onIfStatement(simpleValueResolver: TsSimpleValueResolver, stmt: EtsIfStmt, scope: TsStepScope) {}
22-
fun onIfStatementWithResolvedCondition(simpleValueResolver: TsSimpleValueResolver, stmt: EtsIfStmt, condition: UBoolExpr, scope: TsStepScope) {}
23-
fun onReturnStatement(simpleValueResolver: TsSimpleValueResolver, stmt: EtsReturnStmt, scope: TsStepScope) {}
24-
fun onThrowStatement(simpleValueResolver: TsSimpleValueResolver, stmt: EtsThrowStmt, scope: TsStepScope) {}
25-
fun onGotoStatement(simpleValueResolver: TsSimpleValueResolver, stmt: EtsGotoStmt, scope: TsStepScope) {}
26-
fun onSwitchStatement(simpleValueResolver: TsSimpleValueResolver, stmt: EtsSwitchStmt, scope: TsStepScope) {}
36+
37+
fun onIfStatement(
38+
simpleValueResolver: TsSimpleValueResolver,
39+
stmt: EtsIfStmt,
40+
scope: TsStepScope
41+
) {
42+
// default empty implementation
43+
}
44+
45+
fun onIfStatementWithResolvedCondition(
46+
simpleValueResolver: TsSimpleValueResolver,
47+
stmt: EtsIfStmt,
48+
condition: UBoolExpr,
49+
scope: TsStepScope
50+
) {
51+
// default empty implementation
52+
}
53+
54+
fun onReturnStatement(
55+
simpleValueResolver: TsSimpleValueResolver,
56+
stmt: EtsReturnStmt,
57+
scope: TsStepScope
58+
) {
59+
// default empty implementation
60+
}
61+
62+
fun onThrowStatement(
63+
simpleValueResolver: TsSimpleValueResolver,
64+
stmt: EtsThrowStmt,
65+
scope: TsStepScope
66+
) {
67+
// default empty implementation
68+
}
69+
70+
fun onGotoStatement(
71+
simpleValueResolver: TsSimpleValueResolver,
72+
stmt: EtsGotoStmt,
73+
scope: TsStepScope
74+
) {
75+
// default empty implementation
76+
}
77+
78+
fun onSwitchStatement(
79+
simpleValueResolver: TsSimpleValueResolver,
80+
stmt: EtsSwitchStmt,
81+
scope: TsStepScope
82+
) {
83+
// default empty implementation
84+
}
2785
}

usvm-ts/src/main/kotlin/org/usvm/machine/interpreter/TsInterpreter.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,6 @@ class TsInterpreter(
168168
mockMethodCall(scope, it.method)
169169
return
170170
}
171-
172171
} ?: observer?.onAssignStatement(exprResolver.simpleValueResolver, stmt, scope)
173172

174173

0 commit comments

Comments
 (0)