Example #1
0
        public StackFrame Clone()
        {
            StackFrame other = (StackFrame)this.MemberwiseClone();

            // procedure/implementation does not need to cloned

            other.Locals = this.Locals.Clone();

            if (this.OldGlobals != null)
            {
                other.InternalOldGlobals = this.InternalOldGlobals.Clone();
            }

            // A dummy stack frame doesn't have an instruction iterator
            if (IsDummy)
            {
                return(other);
            }

            // Clone instruction iterator
            other.CurrentInstruction = CurrentInstruction.Clone();

            return(other);
        }