File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
jacodb-ets/src/main/kotlin/org/jacodb/ets/utils Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ import org.jacodb.ets.graph.EtsCfg
2626private fun EtsStmt.toDotLabel (): String = when (this ) {
2727 is EtsNopStmt -> " nop"
2828 is EtsAssignStmt -> " $lhv := $rhv "
29- is EtsReturnStmt -> " return $returnValue "
29+ is EtsReturnStmt -> returnValue?. let { " return $it " } ? : " return "
3030 is EtsIfStmt -> " if ($condition )"
3131 else -> this .toString() // TODO: support more statement types
3232}
@@ -38,8 +38,9 @@ fun EtsCfg.toDot(): String {
3838
3939 // Nodes
4040 stmts.forEach { stmt ->
41- val id= stmt.location.index
42- lines + = " $id [label=\" $id : ${stmt.toDotLabel()} \" ]"
41+ val id = stmt.location.index
42+ val label = stmt.toDotLabel().replace(" \" " , " \\\" " )
43+ lines + = " $id [label=\" $id : $label \" ]"
4344 }
4445
4546 // Edges
You can’t perform that action at this time.
0 commit comments