Skip to content

Commit

Permalink
Allow goto to have no targets
Browse files Browse the repository at this point in the history
  • Loading branch information
atomb committed Mar 19, 2024
1 parent 4cc7547 commit 29979dc
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions Source/Provers/LeanAuto/LeanAutoGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -197,9 +197,13 @@ public override Cmd VisitAssumeCmd(AssumeCmd node)

public override GotoCmd VisitGotoCmd(GotoCmd node)
{
var gotoText = node.labelTargets.Select(l =>
$"goto {BlockName(l)}").Aggregate((a, b) => $"{a} {AndString} {b}");
Indent(2, gotoText);
string cmd = node.labelTargets.Any()
? node
.labelTargets
.Select(l => $"goto {BlockName(l)}")
.Aggregate((a, b) => $"{a} {AndString} {b}")
: "ret";
Indent(2, cmd);
return node;
}

Expand Down

0 comments on commit 29979dc

Please sign in to comment.