When I call FlowGraphFactory.CreateControlFlowGraph on a method with
switch instruction, it throws InvalidCastException.

It assumes that Operand of branch instructions are Instruction. But in
case of switch instruction, Operand is Instruction array.

So, which fix do you prefer?
1. Change Instruction GetBranchTarget(Instruction) to Instruction []
GetBranchTargets(Instruction).
2. Special case switch instruction.

-- 
Seo Sanghyeon

--~--~---------~--~----~------------~-------~--~----~
--
mono-cecil
-~----------~----~----~----~------~----~------~--~---

Reply via email to