stackVariable103.set_Item(stackVariable107, new VariableDefinition(String.Concat("exception_", V_4.ToString()), Utilities.GetCorlibTypeReference(Type.GetTypeFromHandle(// // Current member / type: System.Void Telerik.JustDecompiler.Decompiler.DefineUseAnalysis.StackUsageAnalysis::AnalyzeStackUsage() // Exception in: System.Void AnalyzeStackUsage() // Specified method is not supported. // // mailto: [email protected] private void ComputeStackUsage(InstructionBlock block) { V_0 = new List<int>(this.blockToInitialStackMap[block.get_Index()]); V_1 = block.GetEnumerator(); try { while (V_1.MoveNext()) { V_2 = V_1.get_Current(); if (V_2.get_OpCode().get_Code() != 36) { V_3 = this.GetPopDelta(V_0.get_Count(), V_2); V_4 = this.GetPushDelta(V_2); V_5 = new List<int>(); V_7 = 0; while ((long)V_7 < (ulong)V_3) { V_8 = V_0.get_Count() - 1; V_5.Add(V_0.get_Item(V_8)); V_0.RemoveAt(V_8); V_7 = V_7 + 1; } if (V_4 > 0) { dummyVar0 = this.stackVariableInstructionsSet.Add(V_2.get_Offset()); } V_9 = 0; while ((long)V_9 < (ulong)V_4) { V_0.Add(V_2.get_Offset()); V_9 = V_9 + 1; } this.instructionOffsetToUsedInstructionsMap.set_Item(V_2.get_Offset(), new Stack<int>(V_5)); } else { if (V_0.get_Count() == 0) { throw new Exception("Invalid evaluation stack"); } V_0.Add(V_0.get_Item(V_0.get_Count() - 1)); } } } finally { if (V_1 != null) { V_1.Dispose(); } } this.blockToExitStackMap[block.get_Index()] = V_0.ToArray(); return; }
private void RecursiveDfs(InstructionBlock currentBlock, int[] initialStack) { this.traversed[currentBlock.get_Index()] = true; this.blockToInitialStackMap[currentBlock.get_Index()] = initialStack; this.ComputeStackUsage(currentBlock); V_0 = this.blockToExitStackMap[currentBlock.get_Index()]; V_1 = currentBlock.get_Successors(); V_2 = 0; while (V_2 < (int)V_1.Length) { V_3 = V_1[V_2]; if (this.traversed[V_3.get_Index()]) { this.UpdateCurrentStackVariables(currentBlock, V_3); } else { this.RecursiveDfs(V_3, V_0); } V_2 = V_2 + 1; } return; }
private void UpdateCurrentStackVariables(InstructionBlock parent, InstructionBlock successor) { V_0 = this.blockToExitStackMap[parent.get_Index()]; V_1 = this.blockToInitialStackMap[successor.get_Index()]; if ((int)V_0.Length != (int)V_1.Length) { throw new ArgumentException("Two paths with different stack states encountered."); } V_2 = 0; while (V_2 < (int)V_0.Length) { this.unionFinder.Union(V_1[V_2], V_0[V_2]); V_2 = V_2 + 1; } return; }
private void ReattachDefaultSuccessor(InstructionBlock initialBlock, InstructionBlock currentBlock) { if (InstructionBlock.op_Inequality(initialBlock, currentBlock)) { this.RedirectNonControllerPredecessors(initialBlock, currentBlock); this.SwapCFGBlocks(initialBlock.get_Index(), currentBlock.get_Index()); V_0 = 0; while (V_0 < (int)this.stateToStartBlock.Length) { if (InstructionBlock.op_Equality(this.stateToStartBlock[V_0], initialBlock)) { this.stateToStartBlock[V_0] = currentBlock; } V_0 = V_0 + 1; } } return; }