Match() public méthode

public Match ( Expression e ) : bool
e Expression
Résultat bool
 public override Expression VisitMemoryAccess(MemoryAccess access)
 {
     access.EffectiveAddress = access.EffectiveAddress.Accept(this);
     if (aem.Match(access.EffectiveAddress))
     {
         if (aem.ArrayPointer == null)
         {
             aem.ArrayPointer = Constant.Create(
                 PrimitiveType.Create(
                     Domain.Pointer,
                     access.EffectiveAddress.DataType.Size),
                 0);
         }
         return(aem.Transform(null, access.DataType));
     }
     if (access.EffectiveAddress is BinaryExpression bin && bin.Operator == Operator.IAdd)
     {
         return(access);
     }
     if (access.EffectiveAddress is Constant)
     {
         return(access);
     }
     access.EffectiveAddress = AddZeroToEffectiveAddress(access.EffectiveAddress);
     return(access);
 }
Exemple #2
0
 public override Expression VisitMemoryAccess(MemoryAccess access)
 {
     access.EffectiveAddress = access.EffectiveAddress.Accept(this);
     if (aem.Match(access.EffectiveAddress))
     {
         if (aem.ArrayPointer == null)
         {
             aem.ArrayPointer = Constant.Create(
                 PrimitiveType.Create(
                     Domain.Pointer,
                     access.EffectiveAddress.DataType.Size),
                 0);
         }
         return(aem.Transform(null, access.DataType));
     }
     else if (access.EffectiveAddress is Identifier)
     {
         access.EffectiveAddress = AddZeroToEffectiveAddress(access.EffectiveAddress);
         return(access);
     }
     else
     {
         return(access);
     }
 }
Exemple #3
0
        public override Expression VisitMemoryAccess(MemoryAccess access)
        {
            var ea = access.EffectiveAddress.Accept(this);

            if (aem.Match(ea))
            {
                if (aem.ArrayPointer == null)
                {
                    aem.ArrayPointer = Constant.Create(
                        PrimitiveType.Create(
                            Domain.Pointer,
                            ea.DataType.BitSize),
                        0);
                }
                return(aem.Transform(null, access.DataType));
            }
            var newEa = ExtendEffectiveAddress(ea);

            return(new MemoryAccess(access.MemoryId, newEa, access.DataType));
        }
        public override Expression VisitMemoryAccess(MemoryAccess access)
        {
            var ea = access.EffectiveAddress.Accept(this);

            if (aem.Match(ea))
            {
                if (aem.ArrayPointer == null)
                {
                    aem.ArrayPointer = Constant.Create(
                        PrimitiveType.Create(
                            Domain.Pointer,
                            ea.DataType.BitSize),
                        0);
                }
                return(aem.Transform(null, access.DataType));
            }
            if (!(ea is BinaryExpression bin && bin.Operator == Operator.IAdd) &&
                !(ea is Constant))
            {
                ea = AddZeroToEffectiveAddress(ea);
            }
            return(new MemoryAccess(access.MemoryId, ea, access.DataType));
        }