Skip to content

Commit

Permalink
Merge pull request #822 from viperproject/meilers_fix_silicon_886
Browse files Browse the repository at this point in the history
Added missing variable declaration for checking InEx-Expressions in function postconditions
  • Loading branch information
marcoeilers authored Dec 6, 2024
2 parents 3d95d76 + 333014a commit f7c9468
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ trait FunctionCheck extends ProgramManager with DecreasesCheck with ExpTransform

if (proofMethodBody != EmptyStmt) {
val proofMethod = Method(proofMethodName, f.formalArgs, Nil, f.pres, Nil,
Option(Seqn(Seq(proofMethodBody), Seq(resultVariable))()))(info = f.info)
Option(Seqn(Seq(proofMethodBody), Seq(resultVariable, context.conditionInEx.get))()))(info = f.info)

Seq(proofMethod)
} else {
Expand Down
4 changes: 4 additions & 0 deletions src/test/resources/all/issues/silicon/0883.vpr
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// Any copyright is dedicated to the Public Domain.
// http://creativecommons.org/publicdomain/zero/1.0/


field f: Int

@moreJoins("2")
Expand Down
10 changes: 10 additions & 0 deletions src/test/resources/all/issues/silicon/0886.vpr
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// Any copyright is dedicated to the Public Domain.
// http://creativecommons.org/publicdomain/zero/1.0/


function foo(): Bool
decreases

function bar(): Int
decreases
ensures [foo(), true]

0 comments on commit f7c9468

Please sign in to comment.