public void VisitStoreArg(StoreArg store) { if (m_offset < 0 && store.Index > 0) { StoreArg prev = m_info.Instructions[store.Index - 1] as StoreArg; if (prev != null && prev.Argument == store.Argument) { m_offset = store.Untyped.Offset; Log.DebugLine(this, "Matched at {0:X2}", m_offset); } } }
public void VisitStore(StoreArg store) { if (m_needsCheck) { if (store.Argument == 1 && !m_found1) { m_found1 = true; Log.DebugLine(this, "found value1 use at {0:X2}", store.Untyped.Offset); } else if (store.Argument == 2 && !m_found2) { m_found2 = true; Log.DebugLine(this, "found value2 use at {0:X2}", store.Untyped.Offset); } } }
private long?[] DoTransformArgs(int index) { long?[] args = null; StoreArg store = m_instructions[index] as StoreArg; if (store != null) { long?newValue = null; if (m_state.Stack.Count > 0) // may be zero if the stack hasn't been inited yet { newValue = m_state.Stack.Back().Value; } args = new long?[m_state.Arguments.Length]; m_state.Arguments.CopyTo(args, 0); args[store.Argument] = newValue; } else if (m_instructions[index].Untyped.OpCode.Code == Code.Ldarga || m_instructions[index].Untyped.OpCode.Code == Code.Ldarga_S) { ParameterDefinition param = m_instructions[index].Untyped.Operand as ParameterDefinition; if (param != null) { int arg; if (m_instructions.Method.HasThis) { arg = param.Sequence; } else { arg = param.Sequence - 1; } args = new long?[m_state.Arguments.Length]; m_state.Arguments.CopyTo(args, 0); args[arg] = null; } } else { args = m_state.Arguments; } return(args); }