Exemple #1
0
        public void StoresValueFromAddress()
        {
            var varAddress = _evaluator.Pop();
            var varValue   = _evaluator.Pop();

            var assignment = new DerefAssignment
            {
                Left  = (LocalVariable)varAddress,
                Right = (LocalVariable)varValue
            };

            AddOperation(OperationKind.DerefAssignment, assignment);
        }
Exemple #2
0
        public void LoadValueFromAddress()
        {
            var firstVar = (LocalVariable)_evaluator.Pop();


            var result     = SetNewVReg();
            var assignment = new DerefAssignment
            {
                Left  = result,
                Right = firstVar
            };
            var ptrType = firstVar.ComputedType();

            result.FixedType = new TypeDescription(ptrType.ClrType.GetElementType());
            AddOperation(OperationKind.DerefAssignment, assignment);
        }
Exemple #3
0
        public void LoadValueFromAddress(ClosureEntities closureEntities)
        {
            var firstVar = (LocalVariable)_evaluator.Pop();


            var result     = SetNewVReg();
            var assignment = new DerefAssignment
            {
                Left  = result,
                Right = firstVar
            };
            var ptrType = firstVar.ComputedType();

            if (ptrType.GetClrType(closureEntities).GetElementType() != null)
            {
                result.FixedType = new TypeDescription(ptrType.GetClrType(closureEntities).GetElementType());
            }

            else
            {
                result.FixedType = new TypeDescription(ptrType.GetClrType(closureEntities));
            }
            AddOperation(assignment);
        }