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/VCExpr | |
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/VCExpr')
-rw-r--r-- | Source/VCExpr/SimplifyLikeLineariser.cs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Source/VCExpr/SimplifyLikeLineariser.cs b/Source/VCExpr/SimplifyLikeLineariser.cs index 02e3adda..e0a4b4c6 100644 --- a/Source/VCExpr/SimplifyLikeLineariser.cs +++ b/Source/VCExpr/SimplifyLikeLineariser.cs @@ -271,7 +271,7 @@ namespace Microsoft.Boogie.VCExprAST { sb.Append(TypeToString(t));
} else {
System.IO.StringWriter buffer = new System.IO.StringWriter();
- using (TokenTextWriter stream = new TokenTextWriter("<buffer>", buffer, false)) {
+ using (TokenTextWriter stream = new TokenTextWriter("<buffer>", buffer, /*setTokens=*/ false, /*pretty=*/ false)) {
t.Emit(stream);
}
sb.Append(buffer.ToString());
|