Skip to content

Commit 3bda312

Browse files
committed
Fix sending of deltaPC
1 parent c7fac2f commit 3bda312

File tree

1 file changed

+9
-2
lines changed
  • usvm-ml-gameserver/src/main/kotlin/org.usvm/gameserver/serialization

1 file changed

+9
-2
lines changed

usvm-ml-gameserver/src/main/kotlin/org.usvm/gameserver/serialization/Conversion.kt

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,18 @@ var pcs = mutableSetOf<Int>()
8282
fun <Block : BasicBlock> createGameState(
8383
game: Game<Block>
8484
): GameState {
85-
val (vertices, stateWrappers, blockGraph, pathConditionVertices) = game
85+
val (vertices, stateWrappers, blockGraph, _) = game
8686
val states = stateWrappers.map { it.toState() }
87+
val pcVertices = mutableListOf<PathConditionVertex>()
88+
for (state in states) {
89+
if (!pcs.contains(state.pathCondition.id)) {
90+
pcVertices.add(state.pathCondition)
91+
pcs.add(state.pathCondition.id)
92+
}
93+
}
8794
return GameState(
8895
graphVertices = vertices.map { it.toGameMapVertex() },
89-
pathConditionVertices = pathConditionVertices.map { it.toPathConditionVertex() },
96+
pathConditionVertices = pcVertices,
9097
states = states,
9198
map = blockGraph.toGameMapEdge(vertices)
9299
)

0 commit comments

Comments
 (0)