예제 #1
0
 public bool SetTypeAtIndex(uint index, Stack.DataType type)
 {
     Stack.DataType prev = Vars[(int)index].DataType;
     if (!type.IsUnknown() && (prev.IsUnknown() || prev.Precedence() < type.Precedence()))
     {
         Vars[(int)index].DataType = type;
         return(true);
     }
     return(false);
 }
 public bool UpdateRetType(ulong hash, Stack.DataType returns, bool over = false)
 {
     lock (Program.ThreadLock)
     {
         Native native;
         if (TryGetValue(hash, out native) && !native.ReturnParam.FixedType)
         {
             if (native.ReturnParam.StackType.Precedence() < returns.Precedence())
             {
                 native.ReturnParam.Type = returns.LongName();
                 return(true);
             }
         }
         return(false);
     }
 }
 public bool UpdateParam(ulong hash, Stack.DataType type, int index)
 {
     lock (Program.ThreadLock)
     {
         Native native;
         if (TryGetValue(hash, out native) && !native.Vardiac && index < native.Params.Count)
         {
             Param p = native.Params[index];
             if (p.StackType.Precedence() < type.Precedence() && !p.FixedType)
             {
                 p.Type = type.LongName();
                 return(true);
             }
         }
         return(false);
     }
 }