Esempio n. 1
0
        public void PingReturnUpdate(ExitBlock updatedExit, T callingBlock)
        {
            var caller = callingBlock.FlowState?.Routine;

            // If the update of the analysis is in progress and the caller is not yet analysed (its FlowState is null due to invalidation) or
            // is not within the currently analysed routines, don't enqueue it
            if (callingBlock.FlowState == null ||
                (caller != null && _currentRoutinesLastReturnTypes != null && !_currentRoutinesLastReturnTypes.ContainsKey(caller)))
            {
                return;
            }

            if (caller == null || _callGraph.GetCalleeEdges(caller).All(edge => edge.Callee.IsReturnAnalysed))
            {
                Enqueue(callingBlock);
            }
            else
            {
                _dirtyCallBlocks.TryAdd(callingBlock, null);
            }
        }