static Block GetSwitchTarget(IList <Block> targets, Block fallThrough, Value value) { if (!value.IsInt32()) { return(null); } return(CflowUtils.GetSwitchTarget(targets, fallThrough, (Int32Value)value)); }
Block GetTarget(Block switchBlock) { var val1 = instructionEmulator.Pop(); if (!val1.IsInt32()) { return(null); } return(CflowUtils.GetSwitchTarget(switchBlock.Targets, switchBlock.FallThrough, (Int32Value)val1)); }
bool IBranchHandler.HandleSwitch(Int32Value switchIndex) { var target = CflowUtils.GetSwitchTarget(block.Targets, block.FallThrough, switchIndex); if (target == null) { return(false); } PopPushedArgs(1); block.ReplaceSwitchWithBranch(target); return(true); }