Skip to content

Commit

Permalink
Fix issue #322
Browse files Browse the repository at this point in the history
  • Loading branch information
bkragl authored and RustanLeino committed Dec 24, 2020
1 parent 76016d5 commit f2f75fd
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
4 changes: 2 additions & 2 deletions Source/Core/VCExp.cs
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ private string ConfirmProverPath(string proverPath)
protected void ReportError(string msg)
{
Contract.Requires(msg != null);
throw new ProverOptionException(msg + "\n\n" + Help);
throw new ProverOptionException(msg);
}

protected virtual bool ParseString(string opt, string name, ref string field)
Expand Down Expand Up @@ -341,7 +341,7 @@ public ProverException(string s)
}
}

public class ProverOptionException : Exception
public class ProverOptionException : ProverException
{
public ProverOptionException(string msg)
: base(msg)
Expand Down
8 changes: 3 additions & 5 deletions Source/ExecutionEngine/ExecutionEngine.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1027,16 +1027,14 @@ public static PipelineOutcome InferAndVerify(Program program,
{
ae.Handle(e =>
{
var pe = e as ProverException;
if (pe != null)
if (e is ProverException)
{
printer.ErrorWriteLine(Console.Out, "Fatal Error: ProverException: {0}", e);
printer.ErrorWriteLine(Console.Out, "Fatal Error: ProverException: {0}", e.Message);
outcome = PipelineOutcome.FatalError;
return true;
}

var oce = e as OperationCanceledException;
if (oce != null)
if (e is OperationCanceledException)
{
return true;
}
Expand Down
5 changes: 5 additions & 0 deletions Test/prover/issue-322.bpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// RUN: %boogie -proverOpt:PROVER_PATH=bogus-path "%s" > "%t"
// RUN: %boogie -proverOpt:bogus-option "%s" >> "%t"
// RUN: %diff "%s.expect" "%t"

procedure foo() {}
2 changes: 2 additions & 0 deletions Test/prover/issue-322.bpl.expect
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Fatal Error: ProverException: Cannot find specified prover: bogus-path
Fatal Error: ProverException: Unrecognised prover option: bogus-option

0 comments on commit f2f75fd

Please sign in to comment.