Skip to content

Commit

Permalink
fix to Corral to instrument user defined types such as ref
Browse files Browse the repository at this point in the history
  • Loading branch information
shuvendu-lahiri committed Jul 18, 2018
1 parent 179251c commit 43ade27
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
type Ref;

const unique null : Ref;
var r: Ref;

procedure Foo() {
r := null;
assume {:nonnull} r != null;
}
21 changes: 21 additions & 0 deletions AddOns/PropInst/PropInst/ExampleProperties/nullcheck-csharp.avp
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
GlobalDeclarations
{
function {:inline} {:aliasingQuery} {:mkUniqueFn} aliasQ(p:Ref, q:Ref) returns (bool) { p == q }
}


TemplateVariables
{
var p : Ref;
}


//Check every dereference
CmdRule
{
assume {:nonnull} p != null;
}
-->
{
assert p != null;
}

0 comments on commit 43ade27

Please sign in to comment.