diff options
author | qunyanm <qunyanm@hotmail.com> | 2015-11-25 12:10:31 -0800 |
---|---|---|
committer | qunyanm <qunyanm@hotmail.com> | 2015-11-25 12:10:31 -0800 |
commit | 277e5e7400330f4b26270fcaa4b0a70514b35104 (patch) | |
tree | 8851c762a0cd4cf55aefb3a3a704d2213dcc7ae6 | |
parent | 36a96f3c90bcd2212c7d3d8f24815abf88b56ba5 (diff) | |
parent | 280cb724b7499ed4f09f9a54e5ae457b1eb254ae (diff) |
Merge remote-tracking branch 'refs/remotes/origin/dafny-bug-fix'
-rw-r--r-- | Source/VCGeneration/ConditionGeneration.cs | 6 | ||||
-rw-r--r-- | Test/test2/BadLineNumber.bpl | 15 | ||||
-rw-r--r-- | Test/test2/BadLineNumber.bpl.expect | 7 |
3 files changed, 23 insertions, 5 deletions
diff --git a/Source/VCGeneration/ConditionGeneration.cs b/Source/VCGeneration/ConditionGeneration.cs index 8c54bdf0..19438924 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) { diff --git a/Test/test2/BadLineNumber.bpl b/Test/test2/BadLineNumber.bpl new file mode 100644 index 00000000..b8776a4e --- /dev/null +++ b/Test/test2/BadLineNumber.bpl @@ -0,0 +1,15 @@ +// RUN: %boogie "%s" > "%t" +// RUN: %diff "%s.expect" "%t" + +procedure p(); + ensures false; + +implementation p() +{ + if (*) + { + } + else + { + } +}
\ No newline at end of file diff --git a/Test/test2/BadLineNumber.bpl.expect b/Test/test2/BadLineNumber.bpl.expect new file mode 100644 index 00000000..bc5d1984 --- /dev/null +++ b/Test/test2/BadLineNumber.bpl.expect @@ -0,0 +1,7 @@ +BadLineNumber.bpl(15,1): Error BP5003: A postcondition might not hold on this return path. +BadLineNumber.bpl(5,3): Related location: This is the postcondition that might not hold. +Execution trace: + BadLineNumber.bpl(9,5): anon0 + BadLineNumber.bpl(14,5): anon3_Else + +Boogie program verifier finished with 0 verified, 1 error |