summaryrefslogtreecommitdiff
path: root/Source/VCGeneration/ConditionGeneration.cs
diff options
context:
space:
mode:
authorGravatar qunyanm <qunyanm@hotmail.com>2015-11-25 11:50:43 -0800
committerGravatar qunyanm <qunyanm@hotmail.com>2015-11-25 11:50:43 -0800
commit280cb724b7499ed4f09f9a54e5ae457b1eb254ae (patch)
treeef34d69a8d48e8124f5816506339780dee5edc83 /Source/VCGeneration/ConditionGeneration.cs
parenta799e128af68911228d081202ba0bd294ced4a4f (diff)
Use the EndCurly token when creating the ReturnCmd for unifiedExit
When there are more than one exit blocks, an unified exit block is created which includes a ReturnCmd. However, the ReturnCmd is created with NoToken. This causes the line/column number reported for a failed postcondition to be (0,0). The right token should be the EndCurly since the ReturnCmd is in the exit block.
Diffstat (limited to 'Source/VCGeneration/ConditionGeneration.cs')
-rw-r--r--Source/VCGeneration/ConditionGeneration.cs6
1 files changed, 1 insertions, 5 deletions
diff --git a/Source/VCGeneration/ConditionGeneration.cs b/Source/VCGeneration/ConditionGeneration.cs
index 0e5fce82..043d0985 100644
--- a/Source/VCGeneration/ConditionGeneration.cs
+++ b/Source/VCGeneration/ConditionGeneration.cs
@@ -1134,11 +1134,7 @@ namespace VC {
if (returnBlocks > 1) {
string unifiedExitLabel = "GeneratedUnifiedExit";
Block unifiedExit;
- if (impl.StructuredStmts != null) {
- unifiedExit = new Block(new Token(-17, -4), unifiedExitLabel, new List<Cmd>(), new ReturnCmd(impl.StructuredStmts.EndCurly));
- } else {
- unifiedExit = new Block(new Token(-17, -4), unifiedExitLabel, new List<Cmd>(), new ReturnCmd(Token.NoToken));
- }
+ unifiedExit = new Block(new Token(-17, -4), unifiedExitLabel, new List<Cmd>(), new ReturnCmd(impl.StructuredStmts != null ? impl.StructuredStmts.EndCurly : Token.NoToken));
Contract.Assert(unifiedExit != null);
foreach (Block b in impl.Blocks) {
if (b.TransferCmd is ReturnCmd) {