Python reaching defs fix leading to unbound local variable inspection false positives
[idea/community.git] / platform / lang-impl / src / com / intellij / codeInsight / controlflow / ControlFlowUtil.java
index 0d690cb36dc71231f6e41de885ce60a68b371491..5860786b79e9210a199cc3643259a7f3fe2d81a2 100644 (file)
@@ -56,6 +56,11 @@ public class ControlFlowUtil {
     public void clear() {
       myIndex = -1;
     }
+
+    @Override
+    public String toString() {
+      return "Stack(" + (myIndex + 1) + ") elements";
+    }
   }
 
   public static int[] postOrder(Instruction[] flow) {
@@ -74,7 +79,7 @@ public class ControlFlowUtil {
 
         while (!stack.isEmpty()) {
           final int num = stack.pop();
-          result[num] = N++;
+          result[N++] = num;
           for (Instruction succ : flow[num].allSucc()) {
             final int succNum = succ.num();
             if (!visited[succNum]) {