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 {
}
if prev == nil {
idx := len(graph.Nodes)
node := &Empty{idx: idx}
graph.Nodes = append(graph.Nodes, node)
if len(block.Succs) == 1 {
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:
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