Exemple #1
0
        public static AddressWrapper getAddrW(Instruction inst, IFieldReference fldRef, IMethodDefinition meth)
        {
            if (InstFldRefToAddrWrapperMap.ContainsKey(inst))
            {
                IDictionary <IFieldReference, AddressWrapper> innerDict = InstFldRefToAddrWrapperMap[inst];

                if (innerDict != null && innerDict.ContainsKey(fldRef))
                {
                    return(innerDict[fldRef]);
                }
                if (innerDict == null)
                {
                    InstFldRefToAddrWrapperMap[inst] = new Dictionary <IFieldReference, AddressWrapper>(frc);
                }
            }
            else
            {
                IDictionary <IFieldReference, AddressWrapper> innerDict = new Dictionary <IFieldReference, AddressWrapper>(frc);
                InstFldRefToAddrWrapperMap.Add(inst, innerDict);
            }
            InstructionWrapper instW = getInstW(inst, meth);
            FieldRefWrapper    fldW  = getFieldRefW(fldRef);
            AddressWrapper     addW  = new AddressWrapper(instW, fldW);

            InstFldRefToAddrWrapperMap[inst][fldRef] = addW;
            return(addW);
        }
Exemple #2
0
 public static AddressWrapper getAddrW(IVariable var)
 {
     if (VarToAddrWrapperMap.ContainsKey(var))
     {
         return(VarToAddrWrapperMap[var]);
     }
     else
     {
         VariableWrapper varW = getVarW(var);
         AddressWrapper  addW = new AddressWrapper(varW);
         VarToAddrWrapperMap[var] = addW;
         return(addW);
     }
 }
Exemple #3
0
 public static AddressWrapper getAddrW(IFieldReference fldRef)
 {
     if (FieldRefToAddrWrapperMap.ContainsKey(fldRef))
     {
         return(FieldRefToAddrWrapperMap[fldRef]);
     }
     else
     {
         FieldRefWrapper fldW = getFieldRefW(fldRef);
         AddressWrapper  addW = new AddressWrapper(fldW);
         FieldRefToAddrWrapperMap[fldRef] = addW;
         return(addW);
     }
 }
Exemple #4
0
 public static AddressWrapper getAddrW(IMethodReference mRef)
 {
     if (MethRefToAddrWrapperMap.ContainsKey(mRef))
     {
         return(MethRefToAddrWrapperMap[mRef]);
     }
     else
     {
         MethodRefWrapper mRefW  = getMethodRefW(mRef);
         AddressWrapper   methAW = new AddressWrapper(mRefW);
         MethRefToAddrWrapperMap[mRef] = methAW;
         return(methAW);
     }
 }
Exemple #5
0
 public static AddressWrapper getAddrW(Instruction newArrInst, IMethodDefinition meth)
 {
     if (ArrayToAddrWrapperMap.ContainsKey(newArrInst))
     {
         return(ArrayToAddrWrapperMap[newArrInst]);
     }
     else
     {
         InstructionWrapper instW = getInstW(newArrInst, meth);
         FieldRefWrapper    fldW  = ProgramDoms.domF.GetVal(0);
         AddressWrapper     addW  = new AddressWrapper(instW, fldW);
         ArrayToAddrWrapperMap[newArrInst] = addW;
         return(addW);
     }
 }