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

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

            InstFldRefToHeapElemWrapperMap[inst][fldRef] = hpW;
            return(hpW);
        }
Exemple #2
0
 public static FieldRefWrapper getFieldRefW(IFieldReference fieldRef)
 {
     if (FieldRefToWrapperMap.ContainsKey(fieldRef))
     {
         return(FieldRefToWrapperMap[fieldRef]);
     }
     else
     {
         FieldRefWrapper fRefW = new FieldRefWrapper(fieldRef);
         FieldRefToWrapperMap.Add(fieldRef, fRefW);
         return(fRefW);
     }
 }
Exemple #3
0
 public static HeapElemWrapper getHeapElemW(IFieldReference fldRef)
 {
     if (FieldRefToHeapElemWrapperMap.ContainsKey(fldRef))
     {
         return(FieldRefToHeapElemWrapperMap[fldRef]);
     }
     else
     {
         FieldRefWrapper fldW = getFieldRefW(fldRef);
         HeapElemWrapper hpW  = new HeapElemWrapper(fldW);
         FieldRefToHeapElemWrapperMap[fldRef] = hpW;
         return(hpW);
     }
 }
Exemple #4
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 #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);
     }
 }
 public HeapElemWrapper(InstructionWrapper instW, FieldRefWrapper fldW)
 {
     this.instW = instW;
     this.fldW  = fldW;
     kind       = HeapElemKind.InstFldStructObj;
 }
 public HeapElemWrapper(FieldRefWrapper fldW)
 {
     this.fldW = fldW;
     kind      = HeapElemKind.StatFldStructObj;
 }
Exemple #8
0
 public AddressWrapper(FieldRefWrapper fldRefW)
 {
     this.fldRefW = fldRefW;
     kind         = AddressKind.AddrF;
 }
Exemple #9
0
 public AddressWrapper(InstructionWrapper instW, FieldRefWrapper fldRefW)
 {
     this.instW   = instW;
     this.fldRefW = fldRefW;
     kind         = AddressKind.AddrHF;
 }