summaryrefslogtreecommitdiff
path: root/Source/VCGeneration
diff options
context:
space:
mode:
authorGravatar Rustan Leino <unknown>2013-05-29 18:24:12 -0700
committerGravatar Rustan Leino <unknown>2013-05-29 18:24:12 -0700
commit2c9905f46791fed75c10fc8c8bc144fb8fa461f3 (patch)
treec24ded5b64ff2e9fc0766e13721bd849e453def6 /Source/VCGeneration
parenta9107b72346424a3e6486622cad8284ef731ada9 (diff)
Fixed bug in the cutting of back edges (that manifested itself whenever the first block in a procedure was the target of a back edge)
Diffstat (limited to 'Source/VCGeneration')
-rw-r--r--Source/VCGeneration/VC.cs4
1 files changed, 3 insertions, 1 deletions
diff --git a/Source/VCGeneration/VC.cs b/Source/VCGeneration/VC.cs
index 988d80fd..6a0891b8 100644
--- a/Source/VCGeneration/VC.cs
+++ b/Source/VCGeneration/VC.cs
@@ -1789,13 +1789,15 @@ namespace VC {
}
#endregion
+ // Recompute the predecessors, but first insert a dummy start node that is sure not to be the target of any goto (because the cutting of back edges
+ // below assumes that the start node has no predecessor)
+ impl.Blocks.Insert(0, new Block(new Token(-17, -4), "0", new CmdSeq(), new GotoCmd(Token.NoToken, new StringSeq(impl.Blocks[0].Label), new BlockSeq(impl.Blocks[0]))));
ResetPredecessors(impl.Blocks);
#region Convert program CFG into a DAG
#region Use the graph library to figure out where the (natural) loops are
-
#region Create the graph by adding the source node and each edge
Graph<Block> g = Program.GraphFromImpl(impl);
#endregion