Esempio n. 1
0
 static Block getSwitchTarget(IList <Block> targets, Block fallThrough, Value value)
 {
     if (!value.isInt32())
     {
         return(null);
     }
     return(CflowUtils.getSwitchTarget(targets, fallThrough, (Int32Value)value));
 }
Esempio n. 2
0
        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);
        }
Esempio n. 4
0
		bool emulate_Switch() {
			var val1 = instructionEmulator.pop();

			if (!val1.isInt32())
				return false;
			var target = CflowUtils.getSwitchTarget(block.Targets, block.FallThrough, (Int32Value)val1);
			if (target == null)
				return false;

			popPushedArgs(1);
			block.replaceSwitchWithBranch(target);
			return true;
		}