avoid unnecessary passing around of arch_env_t* in backend APIs
[libfirm] / ir / opt / dead_code_elimination.c
index 8755653..e7169ed 100644 (file)
@@ -47,7 +47,7 @@
 #include "pmap.h"
 
 /** a pointer to the new phases */
-static ir_phase *new_phases[PHASE_LAST];
+static ir_phase *new_phases[PHASE_LAST + 1];
 
 /**
  * Reroute the inputs of a node from nodes in the old graph to copied nodes in
@@ -124,7 +124,10 @@ static void copy_graph_env(ir_graph *irg)
                if (old_ph == NULL)
                        continue;
 
-               phase_free(old_ph);
+               /* Matze: commented out for now: This is a memory leak, but for a real
+                * fix we must not create new phases here, but reuse the old phases
+                * and just create a new data array */
+               /* phase_free(old_ph); */
                irg->phases[i] = new_phases[i];
        }
 }