summaryrefslogtreecommitdiff
path: root/BCT/BytecodeTranslator/Phone
diff options
context:
space:
mode:
authorGravatar t-espave <unknown>2011-07-28 11:13:04 -0700
committerGravatar t-espave <unknown>2011-07-28 11:13:04 -0700
commit04d1828cda6527909a608e30aba851a13b654034 (patch)
tree201bbf24e400a0d4cdfc9d88f115773d0accd8ec /BCT/BytecodeTranslator/Phone
parent36202c6ec5c99b1284323c3077bc35a33c9d4233 (diff)
trivial contract for phone event handlers
Diffstat (limited to 'BCT/BytecodeTranslator/Phone')
-rw-r--r--BCT/BytecodeTranslator/Phone/PhoneCodeHelper.cs9
1 files changed, 9 insertions, 0 deletions
diff --git a/BCT/BytecodeTranslator/Phone/PhoneCodeHelper.cs b/BCT/BytecodeTranslator/Phone/PhoneCodeHelper.cs
index 20b47046..d79d524a 100644
--- a/BCT/BytecodeTranslator/Phone/PhoneCodeHelper.cs
+++ b/BCT/BytecodeTranslator/Phone/PhoneCodeHelper.cs
@@ -584,6 +584,15 @@ namespace BytecodeTranslator.Phone {
}
codeBuilder.Add(new Bpl.HavocCmd(Bpl.Token.NoToken, identVars));
+ // FEEDBACK TODO this is possibly too much, I'm guessing sometimes this args might well be null
+ Bpl.Expr notNullExpr;
+ foreach (Bpl.IdentifierExpr idExpr in identVars) {
+ if (idExpr.Type.Equals(sink.Heap.RefType)) {
+ notNullExpr= Bpl.Expr.Binary(Bpl.BinaryOperator.Opcode.Neq, idExpr, Bpl.Expr.Ident(sink.Heap.NullRef));
+ codeBuilder.Add(new Bpl.AssumeCmd(Bpl.Token.NoToken, notNullExpr));
+ }
+ }
+
Bpl.ExprSeq callParams = new Bpl.ExprSeq();
for (int i = 0; i < identVars.Length; i++) {
callParams.Add(identVars[i]);