Skip to content

Commit

Permalink
AV: Fix to null dereference. Fixes boogie-org#71.
Browse files Browse the repository at this point in the history
  • Loading branch information
rcastano committed Jul 25, 2018
1 parent 38aeb6e commit 34abe74
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion AddOns/AngelicVerifierNull/test/avn-regressions/Answer
Original file line number Diff line number Diff line change
Expand Up @@ -107,4 +107,4 @@

-------------------- type_alias.bpl --------------------
[TAG: AV_OUTPUT] ----- Analyzing type_alias_hinst.bpl ------
[TAG: AV_OUTPUT] AngelicVerifier failed with: Object reference not set to an instance of an object.
[TAG: AV_OUTPUT] EXPLAINERROR-BLOCK :: (forall x_1: int :: unknownTrigger_0(x_1) ==> m[x_1] != r1)
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ type Ref = Union;

const unique r1 : Ref;
const unique null : Ref;
var m : [Ref] Ref;
var m : [int] Ref;

procedure Foo(r : Ref) {
procedure Foo(r : int) {
assert m[r] != r1;
}
2 changes: 1 addition & 1 deletion source/CoreLib/SdvUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ private CallCmd makeRecordCall(IdentifierExpr v)
return new CallCmd(Token.NoToken, recordProcNameBool, ins, new List<IdentifierExpr>());
else if (v.Type.IsCtor)
{
var t = (v.Type as CtorType).Decl.Name;
var t = v.Type.AsCtor.Decl.Name;
if (!typeToRecordProc.ContainsKey(t))
{
var inpVar = new Formal(Token.NoToken, new TypedIdent(Token.NoToken, "x", v.Type), true);
Expand Down

0 comments on commit 34abe74

Please sign in to comment.