Exemplo n.º 1
0
        protected void PingSubscribers(ExitBlock exit)
        {
            if (exit != null)
            {
                bool wasNotAnalysed = false;
                if (_state.Routine?.IsReturnAnalysed == false)
                {
                    wasNotAnalysed = true;
                    _state.Routine.IsReturnAnalysed = true;
                }

                // Ping the subscribers either if the return type has changed or
                // it is the first time the analysis reached the routine exit
                var rtype = _state.GetReturnType();
                if (rtype != exit._lastReturnTypeMask || wasNotAnalysed)
                {
                    exit._lastReturnTypeMask = rtype;
                    var subscribers = exit.Subscribers;
                    if (subscribers.Count != 0)
                    {
                        lock (subscribers)
                        {
                            foreach (var subscriber in subscribers)
                            {
                                _worklist.PingReturnUpdate(exit, subscriber);
                            }
                        }
                    }
                }
            }
        }
Exemplo n.º 2
0
 protected void EnqueueSubscribers(ExitBlock exit)
 {
     if (exit != null)
     {
         var rtype = _state.GetReturnType();
         if (rtype != exit._lastReturnTypeMask)
         {
             exit._lastReturnTypeMask = rtype;
             exit.Subscribers.ForEach(_worklist.Enqueue);
         }
     }
 }
Exemplo n.º 3
0
        public override void VisitCFGExitBlock(ExitBlock x)
        {
            VisitCFGBlock(x);

            // TODO: EdgeToCallers:
            var rtype = _state.GetReturnType();

            if (rtype != x._lastReturnTypeMask)
            {
                x._lastReturnTypeMask = rtype;
                x.Subscribers.ForEach(_worklist.Enqueue);
            }
        }