private Absy GetNextCmd(ExecutionState state)
        {
            var nextCmd = state.GetCurrentStackFrame().CurrentInstruction.Clone();

            nextCmd.MoveNext();
            return(nextCmd.Current);
        }
Example #2
0
        public override Expr VisitOldExpr(OldExpr node)
        {
            var oldGlobals = State.GetCurrentStackFrame().OldGlobals;

            Debug.Assert(oldGlobals != null, "Old Globals should not be null!");
            Debug.Assert(node.Expr is IdentifierExpr && (node.Expr as IdentifierExpr).Decl is GlobalVariable, "Unexpected expression in OldExpr");
            var GV = (node.Expr as IdentifierExpr).Decl as GlobalVariable;

            if (GV == null)
            {
                throw new InvalidOperationException("Visited OldExpr but child node was not the expected type");
            }

            Debug.Assert(oldGlobals.ContainsKey(GV), "A global variable is missing from the Current stackframe's list of OldGlobals");
            return(oldGlobals[GV]);
        }
Example #3
0
        private bool TerminateIfDepthExceeded(ExecutionState state)
        {
            if (state.ExplicitBranchDepth > MaxDepth)
            {
                // Don't remove from the UnderlyingStateScheduler here as it might not have been added to the UnderlyingStateScheduler

                Debug.Assert(TheExecutor != null, "TheExecutor cannot be null");
                // Estimate where we terminate
                var programLoc = state.GetCurrentStackFrame().CurrentInstruction.Current.GetProgramLocation();
                TheExecutor.TerminateState(state, new TerminatedWithDisallowedExplicitBranchDepth(programLoc), /*removeFromStateScheduler=*/ false);
                return(true);
            }
            else
            {
                return(false);
            }
        }