示例#1
0
 private void OpVerify()
 {
     if (!MainStack.PopBool())
     {
         throw new VerifyFailedException();
     }
 }
示例#2
0
        private void OpNotIf()
        {
            switch (BranchStack.Peek())
            {
            case BranchOption.Skip:
            case BranchOption.False:
                BranchStack.Push(BranchOption.Skip);
                break;

            case BranchOption.True:
                BranchStack.Push(!MainStack.PopBool() ? BranchOption.True : BranchOption.False);
                break;
            }
        }
示例#3
0
        private bool RunInternal(Script script)
        {
            foreach (var subScriptOps in script.Subscripts)
            {
                // Reset operation counter between subscripts
                this.NumOperations = 0;

                foreach (var op in subScriptOps)
                {
                    if (!CanExecuteNextOpCode(op))
                    {
                        continue;
                    }

                    IncrementOpCounter(op.Code);
                    VerifyOpDataSize(op.Data.Length);
                    Execute(op);
                }

                EnsureBranchStackClean();
            }

            return(MainStack.PopBool());
        }