Esempio n. 1
0
        private ObjPtr SelectDeepObject(ObjPtr ptr, int depth = 0)
        {
            if (depth > 100)// || _rnd.Next(100) > 50)
            {
                return(ptr);
            }

            var refs = _ctx.Runtime.GetRefs(ptr);

            refs[_rnd.Next(0, refs.Length)].GetValue(_ctx.Runtime.ObjToBlock(ptr), _refBuffer.buffPtr);
            return(_refBuffer.Value == IntPtr.Zero ? ptr : this.SelectDeepObject(_ctx.Runtime.BlockToObj(new BlockPtr(_refBuffer.Value)), depth + 1));
        }
Esempio n. 2
0
        public void SpliceObject(ObjPtr oldRef, ObjPtr newRef)
        {
            if (_ctx.Statics.Remove(oldRef))
            {
                _ctx.Statics.Add(newRef);
            }

            for (var f = _root; f != null; f = f.Next)
            {
                if (f.Locals.Remove(oldRef))
                {
                    f.Locals.Add(newRef);
                }
            }
        }