Skip to content

Commit

Permalink
Another fix for #141
Browse files Browse the repository at this point in the history
  • Loading branch information
DavePearce committed Mar 28, 2018
1 parent 32db671 commit a5ad496
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/main/java/wyal/util/Interpreter.java
Original file line number Diff line number Diff line change
Expand Up @@ -665,10 +665,11 @@ protected void checkTypeInvariants(Tuple<VariableDeclaration> vars, Environment
for (int i = 0; i != vars.size(); ++i) {
VariableDeclaration decl = vars.get(i);
Expr invariant = extractor.extract(decl.getType(), new Expr.VariableAccess(decl));
// NOTE: need to allocate extracted invariant here since it is not a
// source-level construct. Is kinda strange that we have to do this.
invariant = decl.getHeap().allocate(invariant);
if (invariant != null) {
// NOTE: need to allocate extracted invariant here since it is not a
// source-level construct. Is kinda strange that we have to do this.
invariant = decl.getHeap().allocate(invariant);
//
boolean b = (Boolean) evaluateExpression(invariant, environment);
if (!b) {
throw new UndefinedException("invalid type invariant");
Expand Down

0 comments on commit a5ad496

Please sign in to comment.