fix printing bug when graph empty

This commit is contained in:
ChUrl
2021-01-30 16:59:31 +01:00
parent 70d05ad05f
commit 1326e3b6cc
2 changed files with 8 additions and 0 deletions

View File

@ -73,6 +73,10 @@ public final class DataFlowGraph {
// Printing
public String printToImage() {
if (this.graph.isEmpty()) {
return "Empty Graph";
}
final StringBuilder dot = new StringBuilder();
dot.append("digraph dfd {\n")

View File

@ -153,6 +153,10 @@ public class FlowGraph {
}
public String printToImage() {
if (this.basicBlocks.isEmpty()) {
return "Empty Graph";
}
final StringBuilder dot = new StringBuilder();
dot.append("digraph dfd {\n")