summaryrefslogtreecommitdiff
path: root/Source/Core/Absy.cs
diff options
context:
space:
mode:
authorGravatar 0biha <unknown>2015-01-05 14:52:47 +0100
committerGravatar 0biha <unknown>2015-01-05 14:52:47 +0100
commit8b29c0e6b307ccfa65970d7a344bb94d433813fe (patch)
tree9c8d664792c02ffcf8324bd0d83349317e62515c /Source/Core/Absy.cs
parentbce4de2f7c19fe59e650cb89a14e50a817b4b9ab (diff)
Made invariant of class 'AtomicRE' robust by changing the design
(replaced public field by private field + getter/setter)
Diffstat (limited to 'Source/Core/Absy.cs')
-rw-r--r--Source/Core/Absy.cs24
1 files changed, 21 insertions, 3 deletions
diff --git a/Source/Core/Absy.cs b/Source/Core/Absy.cs
index 56ccfa9e..9fb44108 100644
--- a/Source/Core/Absy.cs
+++ b/Source/Core/Absy.cs
@@ -4218,24 +4218,42 @@ namespace Microsoft.Boogie {
}
}
public class AtomicRE : RE {
- public Block/*!*/ b;
+ private Block/*!*/ _b;
+
+ public Block b
+ {
+ get
+ {
+ Contract.Ensures(Contract.Result<Block>() != null);
+ return this._b;
+ }
+ set
+ {
+ Contract.Requires(value != null);
+ this._b = value;
+ }
+ }
+
[ContractInvariantMethod]
void ObjectInvariant() {
- Contract.Invariant(b != null);
+ Contract.Invariant(this._b != null);
}
public AtomicRE(Block block) {
Contract.Requires(block != null);
- b = block;
+ this._b = block;
}
+
public override void Resolve(ResolutionContext rc) {
//Contract.Requires(rc != null);
b.Resolve(rc);
}
+
public override void Typecheck(TypecheckingContext tc) {
//Contract.Requires(tc != null);
b.Typecheck(tc);
}
+
public override void Emit(TokenTextWriter stream, int level) {
//Contract.Requires(stream != null);
b.Emit(stream, level);