예제 #1
0
		// 00: ldarg.0    n
        // 01: ldarg.1    m
        // 02: mul.ovf    
        // 03: conv.i8
		public void VisitConvert(Conv convert)
		{
			if (m_offset < 0)
			{
				switch (convert.Untyped.OpCode.Code)
				{
					case Code.Conv_I8:
					case Code.Conv_Ovf_I8_Un:
					case Code.Conv_Ovf_I8:
					case Code.Conv_U8:
					case Code.Conv_Ovf_U8_Un:
					case Code.Conv_Ovf_U8:
						OpCode prev = m_info.Instructions[convert.Index - 1].Untyped.OpCode;
						if (prev.Code == Code.Mul || prev.Code == Code.Mul_Ovf || prev.Code == Code.Mul_Ovf_Un)
						{
							if (IntegerHelpers.IsIntOperand(m_info, convert.Index - 1, 0) || IntegerHelpers.IsIntOperand(m_info, convert.Index - 1, 1))
							{
								m_offset = convert.Untyped.Offset;						
								Log.DebugLine(this, "bad convert at {0:X2}", m_offset);											
							}						
						}
						break;	
				}
			}
		}
예제 #2
0
		public void VisitConvert(Conv convert)
		{
			if (m_offset < 0 && convert.Index >= 3)
			{
				switch (convert.Untyped.OpCode.Code)
				{
					case Code.Conv_R4:
					case Code.Conv_R8:
					case Code.Conv_R_Un:
						OpCode prev = m_info.Instructions[convert.Index - 1].Untyped.OpCode;
						if (prev.Code == Code.Div || prev.Code == Code.Div_Un)
						{
							if (IntegerHelpers.IsIntOperand(m_info, convert.Index - 1, 0) && IntegerHelpers.IsIntOperand(m_info, convert.Index - 1, 1))
							{
								m_offset = convert.Untyped.Offset;						
								Log.DebugLine(this, "bad convert at {0:X2}", m_offset);											
							}
						}
						break;	
				}
			}
		}