Ejemplo n.º 1
0
        public override StatementList AllocStaticVariable(IFieldReference field)
        {
            StaticField    p  = new StaticField(new StaticFieldAccess(field));
            BoogieVariable bv = BoogieVariable.From(p);

            return(dispatcher.AllocAddr(bv));
        }
Ejemplo n.º 2
0
 public override StatementList WriteAddr(Addressable addr, Expression expr)
 {
     if (addr is InstanceField instanceField)
     {
         var instanceName = instanceField.Instance;
         var fieldName    = FieldTranslator.GetFieldName(instanceField.Field);
         if (Settings.SplitFieldsEnabled())
         {
             return(SplitFieldUpdate.ForKeyValue(instanceField, expr));
         }
         else
         {
             return(HeapUpdate.ForKeyValue(instanceField, expr));
         }
     }
     else if (addr is StaticField staticField)
     {
         var boogieVar = BoogieVariable.From(staticField);
         return(bg.VariableAssignment(boogieVar, expr));
     }
     else if (addr is DotNetVariable v)
     {
         return(BoogieStatement.VariableAssignment(BoogieVariable.FromDotNetVariable(v.Var), expr));
     }
     else
     {
         throw new NotImplementedException();
     }
 }
Ejemplo n.º 3
0
        public override Addressable AddressOf(StaticFieldAccess staticFieldAccess)
        {
            var address = new AddressExpression(staticFieldAccess.Field.Type, BoogieVariable.From(new StaticField(staticFieldAccess)));

            return(address);
        }