Skip to content

Commit

Permalink
Merge pull request #718 from viperproject/meilers_fix_717
Browse files Browse the repository at this point in the history
Fixing issue #717
  • Loading branch information
marcoeilers authored Jul 8, 2023
2 parents 64016f1 + d12c26e commit 2e9bffc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ object ImpureAssumeRewriter {
val insideWand = c.ancestorList.foldLeft[Boolean](false)((b, n) => b || n.isInstanceOf[MagicWand])
val dummyVars = (LazyList.from(0) map (i => placeholderVar(i, pred.loc.loc(program).formalArgs(i).typ))) take pred.loc.args.length
val eqs = (pred.loc.args zip dummyVars) map (a => EqCmp(a._1, a._2)())
val cond = eqs.tail.foldLeft[Exp](eqs.head)((a, e) => And(a,e)())
val cond = if (eqs.isEmpty) TrueLit()() else eqs.tail.foldLeft[Exp](eqs.head)((a, e) => And(a,e)())
val newCtxFrame = ((And(c.c, cond)(), dummyVars), pred.perm)
val oldCtxFrames = collCont.getOrElse(pred.loc.loc(program), Seq())
collCont += (pred.loc.loc(program) -> (oldCtxFrames :+ newCtxFrame))
Expand Down
8 changes: 8 additions & 0 deletions src/test/resources/all/issues/silver/0717.vpr
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// Any copyright is dedicated to the Public Domain.
// http://creativecommons.org/publicdomain/zero/1.0/

predicate p()

method client() {
assume p()
}

0 comments on commit 2e9bffc

Please sign in to comment.