예제 #1
0
        protected void InsertPostConditionEdges(BlockWithLabels <Label> previousBlock, BlockWithLabels <Label> newBlock)
        {
            var methodCallBlock = previousBlock as MethodCallBlock <Label>;

            if (methodCallBlock == null)
            {
                return;
            }

            if (CurrentSubroutine.IsMethod)
            {
                var      methodInfo = CurrentSubroutine as IMethodInfo;
                Property property;
                if (methodInfo != null && MetaDataProvider.IsConstructor(methodInfo.Method) &&
                    MetaDataProvider.IsPropertyGetter(methodCallBlock.CalledMethod, out property) &&
                    MetaDataProvider.IsAutoPropertyMember(methodCallBlock.CalledMethod))
                {
                    return;
                }
            }

            EdgeTag    callTag = methodCallBlock.IsNewObj ? EdgeTag.AfterNewObj : EdgeTag.AfterCall;
            Subroutine ensures = this.SubroutineFacade.GetEnsures(methodCallBlock.CalledMethod);

            CurrentSubroutine.AddEdgeSubroutine(previousBlock, newBlock, ensures, callTag);
        }