Commit 4536a3ae authored by Etienne Renault's avatar Etienne Renault

Fixes #12.

* transform/cfg/build.go: Here.
parent e3a89ef7
...@@ -130,8 +130,17 @@ func Build(meta *transform.Meta, block *ast.BlockStmt) *Graph { ...@@ -130,8 +130,17 @@ func Build(meta *transform.Meta, block *ast.BlockStmt) *Graph {
} }
if prev == nil { if prev == nil {
idx := len(graph.Nodes) idx := len(graph.Nodes)
node := &Empty{idx: idx} if len(block.Succs) == 1 {
graph.Nodes = append(graph.Nodes, node) node := &Single{
idx: idx,
Stmt: &ast.EmptyStmt{},
Succ: int(block.Succs[0].Index),
}
graph.Nodes = append(graph.Nodes, node)
} else {
node := &Empty{idx: idx}
graph.Nodes = append(graph.Nodes, node)
}
} }
case 2: case 2:
var prev *Single var prev *Single
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment