Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check command #947

Draft
wants to merge 12 commits into
base: master
Choose a base branch
from
Prev Previous commit
Next Next commit
Renames
  • Loading branch information
keyboardDrummer committed Sep 16, 2024
commit d879869516f051b97fbe6dc3fe8ca9c57f138cff
14 changes: 7 additions & 7 deletions Source/Concurrency/LinearTypeChecker.cs
Original file line number Diff line number Diff line change
@@ -764,23 +764,23 @@ private void CheckLinearStoreAccessInGuards()
while (stmtLists.Count > 0)
{
var stmtList = stmtLists.Pop();
stmtList.BigBlocks.Where(bigBlock => bigBlock.ec != null).ForEach(bigBlock => {
switch (bigBlock.ec) {
stmtList.BigBlocks.Where(bigBlock => bigBlock.Ec != null).ForEach(bigBlock => {
switch (bigBlock.Ec) {
case IfCmd ifCmd:
void ProcessIfCmd(IfCmd ifCmd)
{
if (ifCmd.Guard != null && LinearStoreVisitor.HasLinearStoreAccess(ifCmd.Guard))
{
checkingContext.Error(ifCmd.tok, "access to linear store not allowed");
}
stmtLists.Push(ifCmd.thn);
if (ifCmd.elseIf != null)
stmtLists.Push(ifCmd.Thn);
if (ifCmd.ElseIf != null)
{
ProcessIfCmd(ifCmd.elseIf);
ProcessIfCmd(ifCmd.ElseIf);
}
else if (ifCmd.elseBlock != null)
else if (ifCmd.ElseBlock != null)
{
stmtLists.Push(ifCmd.elseBlock);
stmtLists.Push(ifCmd.ElseBlock);
}
}
ProcessIfCmd(ifCmd);
Loading