public LocalVar(MethodInfo m, CodeInstruction instruction) { method = m; if (!instruction.IsLdloc() && !instruction.IsStloc()) { throw new Exception("Code instruction is not a Ldloc or Stloc"); } var t = instruction.ToLocalVar(); index = t.index; builder = t.builder; }