Example #1
0
        public void EmitLoadValidObject(Operand operand, ILabel invalidObject, bool reuse = false)
        {
            if (!reuse)
            {
                EmitLoadOperand(operand);
            }

            // Check to see if object number is 0.
            var objNumOk = il.NewLabel();

            il.Duplicate();
            objNumOk.BranchIf(Condition.True, @short: true);

            // TODO: Emit warning messsage to log. For now, just pop the number off the stack.
            il.Pop();

            // Jump to failure branch
            invalidObject.Branch();

            objNumOk.Mark();
        }