Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
shazqadeer committed Nov 17, 2024
1 parent 6b8fbed commit 1b9a093
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 6 deletions.
1 change: 0 additions & 1 deletion Source/Concurrency/CivlUtil.cs
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,6 @@ public static int ResolveAndTypecheck(CoreOptions options, Absy absy, Resolution
}

var tc = new TypecheckingContext(null, options);
tc.CheckModifies = false; // to prevent access to tc.Proc which is null
absy.Typecheck(tc);
return tc.ErrorCount;
}
Expand Down
3 changes: 0 additions & 3 deletions Source/Concurrency/LinearRewriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -530,10 +530,7 @@ private void ResolveAndTypecheck(CoreOptions options, IEnumerable<Absy> absys)
return;
}
var tc = new TypecheckingContext(null, options);
var oldCheckModifies = tc.CheckModifies;
tc.CheckModifies = false;
absys.ForEach(absy => absy.Typecheck(tc));
tc.CheckModifies = oldCheckModifies;
}

private List<Cmd> CreateAccessAsserts(Expr expr, IToken tok, string msg)
Expand Down
3 changes: 1 addition & 2 deletions Source/Core/ResolutionContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -751,13 +751,12 @@ public class TypecheckingContext : CheckingContext
public LayerRange ExpectedLayerRange;
public bool GlobalAccessOnlyInOld;
public int InsideOld;
public bool CheckModifies;
public bool CheckModifies => Proc != null && (Proc.IsPure || (!Options?.DoModSetAnalysis ?? true));

public TypecheckingContext(IErrorSink errorSink, CoreOptions options)
: base(errorSink)
{
this.Options = options;
this.CheckModifies = !options?.DoModSetAnalysis ?? true;
}

public bool InFrame(Variable v)
Expand Down

0 comments on commit 1b9a093

Please sign in to comment.