Skip to content

Commit

Permalink
Merge pull request #721 from mimo31/pred-acc-arg-purity-check
Browse files Browse the repository at this point in the history
Add purity checks for predicate access arguments
  • Loading branch information
marcoeilers authored Jul 13, 2023
2 parents d769c1e + 828d434 commit a28b06f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/main/scala/viper/silver/ast/Expression.scala
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,7 @@ case class PredicateAccess(args: Seq[Exp], predicateName: String)

def loc(p:Program) = p.findPredicate(predicateName)
lazy val typ = Bool
override lazy val check : Seq[ConsistencyError] = args.flatMap(Consistency.checkPure)

/** The body of the predicate with the arguments instantiated correctly. */
def predicateBody(program : Program, scope: Set[String]) = {
Expand Down
9 changes: 9 additions & 0 deletions src/test/resources/all/issues/silver/0720.vpr
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// Any copyright is dedicated to the Public Domain.
// http://creativecommons.org/publicdomain/zero/1.0/

predicate p(flag: Bool)

method client() {
//:: ExpectedOutput(consistency.error)
inhale p(p(false))
}

0 comments on commit a28b06f

Please sign in to comment.