Exemplo n.º 1
0
        public override void VisitInvocationExpression(InvocationExpressionSyntax node)
        {
            FunctionDepth++;

            // Need to grab the symbol, and evaluate the function
            var methodDeclNode = CacheAnalysisUtil.GetMethodDeclarationNode(node, _context);

            methodDeclNode?.Accept(this);

            base.VisitInvocationExpression(node);

            FunctionDepth--;
        }
        public override void VisitIdentifierName(IdentifierNameSyntax node)
        {
            // Is this a method invocation expression (anonymous delegate)?
            var methodDeclNode = CacheAnalysisUtil.GetMethodDeclarationNode(node, _context);

            if (methodDeclNode != null)
            {
                _nullValueWalker.Visit(methodDeclNode);
            }

            // For visiting a non-literal variable
            // perform data-flow analysis
            var possibleNullAssignments = CacheAnalysisUtil.GetNullAssignmentNodes(node, _context);

            foreach (var assignment in possibleNullAssignments)
            {
                _hasPossibleNullValue = true;
                _possibleNullValues.Add(assignment);
            }

            base.VisitIdentifierName(node);
        }