diff options
author | 2014-07-15 20:25:37 +0100 | |
---|---|---|
committer | 2014-07-15 20:25:37 +0100 | |
commit | 2212c8ea826dfbbc65beef73c7ee50814175c176 (patch) | |
tree | fc27acb5b0c795e5d6444f7f313667903bf5356e /Source/Core/Util.cs | |
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/Core/Util.cs')
-rw-r--r-- | Source/Core/Util.cs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Source/Core/Util.cs b/Source/Core/Util.cs index 6aafec7f..75cb25aa 100644 --- a/Source/Core/Util.cs +++ b/Source/Core/Util.cs @@ -252,7 +252,7 @@ namespace Microsoft.Boogie { }
}
- public TokenTextWriter(string filename, bool pretty = false)
+ public TokenTextWriter(string filename, bool pretty)
: base() {
Contract.Requires(filename != null);
this.pretty = pretty;
@@ -260,7 +260,7 @@ namespace Microsoft.Boogie { this.writer = new StreamWriter(filename);
}
- public TokenTextWriter(string filename, bool setTokens, bool pretty = false)
+ public TokenTextWriter(string filename, bool setTokens, bool pretty)
: base() {
Contract.Requires(filename != null);
this.pretty = pretty;
@@ -269,7 +269,7 @@ namespace Microsoft.Boogie { this.setTokens = setTokens;
}
- public TokenTextWriter(string filename, TextWriter writer, bool setTokens, bool pretty = false)
+ public TokenTextWriter(string filename, TextWriter writer, bool setTokens, bool pretty)
: base() {
Contract.Requires(writer != null);
Contract.Requires(filename != null);
@@ -279,7 +279,7 @@ namespace Microsoft.Boogie { this.setTokens = setTokens;
}
- public TokenTextWriter(string filename, TextWriter writer, bool pretty = false)
+ public TokenTextWriter(string filename, TextWriter writer, bool pretty)
: base() {
Contract.Requires(writer != null);
Contract.Requires(filename != null);
@@ -288,7 +288,7 @@ namespace Microsoft.Boogie { this.writer = writer;
}
- public TokenTextWriter(TextWriter writer, bool pretty = false)
+ public TokenTextWriter(TextWriter writer, bool pretty)
: base() {
Contract.Requires(writer != null);
this.pretty = pretty;
|