diff options
author | Dan Liew <daniel.liew@imperial.ac.uk> | 2014-07-15 20:25:37 +0100 |
---|---|---|
committer | Dan Liew <daniel.liew@imperial.ac.uk> | 2014-07-15 20:25:37 +0100 |
commit | 2212c8ea826dfbbc65beef73c7ee50814175c176 (patch) | |
tree | fc27acb5b0c795e5d6444f7f313667903bf5356e /Source/Houdini | |
parent | 74090e6fc892db326c6f98b8adb790f1f09fba41 (diff) |
Fix nasty bug introduced by commit 61a94f409975.
There were many calls in the code to
``` new TokenTextWriter("<buffer>", buffer, false) ```
Prior to 61a94f409975 this was a call to the following constructor
```
TokenTextWriter(string filename, TextWriter writer, bool setTokens)
```
After that commit these then became calls to
```
TokenTextWriter(string filename, TextWriter writer, bool pretty)
```
An example of where this would cause issues was if ToString() was called on an
AbsyCmd then the its token would be modified because the setTokens parameter
was effectively set to True when the original intention was for it to be set
to false!
To fix this I've
* Removed the default parameter value for pretty and fixed all
uses so that we pass false where it was implicitly being set before
* Where the intention was to set setTokens to false this has been fixed so
it is actually set to false!
Unfortunately I couldn't find a way of observing this bug from the Boogie
executable so I couldn't create a test case. I could only observe it when I was
using Boogie's APIs.
Diffstat (limited to 'Source/Houdini')
-rw-r--r-- | Source/Houdini/AbstractHoudini.cs | 6 | ||||
-rw-r--r-- | Source/Houdini/Houdini.cs | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/Source/Houdini/AbstractHoudini.cs b/Source/Houdini/AbstractHoudini.cs index 8b038554..716456ea 100644 --- a/Source/Houdini/AbstractHoudini.cs +++ b/Source/Houdini/AbstractHoudini.cs @@ -283,7 +283,7 @@ namespace Microsoft.Boogie.Houdini { private void PrintFunction(Function function)
{
- var tt = new TokenTextWriter(Console.Out);
+ var tt = new TokenTextWriter(Console.Out, /*pretty=*/ false);
var invars = new List<Expr>(function.InParams.OfType<Variable>().Select(v => Expr.Ident(v)));
function.Body = function2Value[function.Name].Gamma(invars);
function.Emit(tt, 0);
@@ -2436,7 +2436,7 @@ namespace Microsoft.Boogie.Houdini { }
}
- using (var wt = new TokenTextWriter(WitnessFile))
+ using (var wt = new TokenTextWriter(WitnessFile, /*pretty=*/ false))
{
program.Emit(wt);
}
@@ -2489,7 +2489,7 @@ namespace Microsoft.Boogie.Houdini { }
}
- using (var wt = new TokenTextWriter(WitnessFile))
+ using (var wt = new TokenTextWriter(WitnessFile, /*pretty=*/ false))
{
program.Emit(wt);
}
diff --git a/Source/Houdini/Houdini.cs b/Source/Houdini/Houdini.cs index adb86598..af1bd8ad 100644 --- a/Source/Houdini/Houdini.cs +++ b/Source/Houdini/Houdini.cs @@ -747,7 +747,7 @@ namespace Microsoft.Boogie.Houdini { cexWriter.WriteLine("Counter example for " + refutedAnnotation.Constant);
cexWriter.Write(error.ToString());
cexWriter.WriteLine();
- using (var writer = new Microsoft.Boogie.TokenTextWriter(cexWriter))
+ using (var writer = new Microsoft.Boogie.TokenTextWriter(cexWriter, /*pretty=*/ false))
foreach (Microsoft.Boogie.Block blk in error.Trace)
blk.Emit(writer, 15);
//cexWriter.WriteLine();
|