private bool TryTraverseAndMerge(ILogicalConstruct theConstruct)
 {
     V_0 = new HashSet <ILogicalConstruct>();
     V_1 = new Queue <ILogicalConstruct>();
     V_1.Enqueue(theConstruct.get_Entry() as ILogicalConstruct);
     V_2 = false;
     while (V_1.get_Count() > 0)
     {
         V_3 = V_1.Dequeue();
         V_4 = V_3 as ConditionLogicalConstruct;
         if (V_4 != null)
         {
             V_5 = this.CreateComplexCondition(V_4);
             V_2 = V_2 | V_5 != V_3;
             V_3 = V_5;
         }
         dummyVar0 = V_0.Add(V_3);
         V_6       = V_3.get_SameParentSuccessors().GetEnumerator();
         try
         {
             while (V_6.MoveNext())
             {
                 V_7 = (ILogicalConstruct)V_6.get_Current();
                 if (V_0.Contains(V_7))
                 {
                     continue;
                 }
                 V_1.Enqueue(V_7);
             }
         }
         finally
         {
             ((IDisposable)V_6).Dispose();
         }
         while (V_1.get_Count() > 0 && V_0.Contains(V_1.Peek()))
         {
             dummyVar1 = V_1.Dequeue();
         }
     }
     return(V_2);
 }
Exemplo n.º 2
0
 private void ProcessLogicalConstruct(ILogicalConstruct theConstruct)
 {
     if (theConstruct as BlockLogicalConstruct == null)
     {
         if (theConstruct as ExceptionHandlingLogicalConstruct == null)
         {
             if (theConstruct as IfLogicalConstruct == null)
             {
                 if (theConstruct as LoopLogicalConstruct == null)
                 {
                     if (theConstruct as SwitchLogicalConstruct == null)
                     {
                         if (theConstruct as ConditionLogicalConstruct != null)
                         {
                             this.ProcessLogicalConstruct((theConstruct as ConditionLogicalConstruct).get_FirstBlock());
                         }
                     }
                     else
                     {
                         V_6 = theConstruct as SwitchLogicalConstruct;
                         V_7 = V_6.get_ConditionCases();
                         V_2 = 0;
                         while (V_2 < (int)V_7.Length)
                         {
                             this.ProcessLogicalConstruct(V_7[V_2]);
                             V_2 = V_2 + 1;
                         }
                         this.ProcessLogicalConstruct(V_6.get_DefaultCase());
                     }
                 }
                 else
                 {
                     V_5 = theConstruct as LoopLogicalConstruct;
                     this.ProcessLogicalConstruct(V_5.get_LoopBodyBlock());
                     this.ProcessLogicalConstruct(V_5.get_LoopCondition());
                 }
             }
             else
             {
                 V_4 = theConstruct as IfLogicalConstruct;
                 this.ProcessLogicalConstruct(V_4.get_Then());
                 if (V_4.get_Else() != null)
                 {
                     this.ProcessLogicalConstruct(V_4.get_Else());
                 }
             }
         }
         else
         {
             this.ProcessLogicalConstruct((theConstruct as ExceptionHandlingLogicalConstruct).get_Try());
             if (theConstruct as TryCatchFilterLogicalConstruct == null)
             {
                 if (theConstruct as TryFaultLogicalConstruct == null)
                 {
                     if (theConstruct as TryFinallyLogicalConstruct != null)
                     {
                         this.ProcessLogicalConstruct((theConstruct as TryFinallyLogicalConstruct).get_Finally());
                     }
                 }
                 else
                 {
                     this.ProcessLogicalConstruct((theConstruct as TryFaultLogicalConstruct).get_Fault());
                 }
             }
             else
             {
                 V_1 = (theConstruct as TryCatchFilterLogicalConstruct).get_Handlers();
                 V_2 = 0;
                 while (V_2 < (int)V_1.Length)
                 {
                     V_3 = V_1[V_2];
                     if (V_3.get_HandlerType() != 1)
                     {
                         if (V_3.get_HandlerType() == FilteringExceptionHandlerType.Catch)
                         {
                             this.ProcessLogicalConstruct(V_3 as ExceptionHandlingBlockCatch);
                         }
                     }
                     else
                     {
                         this.ProcessLogicalConstruct((V_3 as ExceptionHandlingBlockFilter).get_Filter());
                         this.ProcessLogicalConstruct((V_3 as ExceptionHandlingBlockFilter).get_Handler());
                     }
                     V_2 = V_2 + 1;
                 }
             }
         }
     }
     else
     {
         V_0 = (ILogicalConstruct)theConstruct.get_Entry();
         while (V_0 != null)
         {
             this.ProcessLogicalConstruct(V_0);
             if (this.visitedConstructs.Contains(V_0.get_FollowNode()))
             {
                 V_0.set_CFGFollowNode(null);
             }
             V_0 = V_0.get_FollowNode();
         }
         this.ProcessGotoFlowConstructs(theConstruct as BlockLogicalConstruct);
     }
     dummyVar0 = this.visitedConstructs.Add(theConstruct);
     return;
 }