fixed debug output of unary x87 nodes
[libfirm] / ir / be / bespillslots.c
index a1a4587..ea0eee4 100644 (file)
@@ -161,10 +161,10 @@ static spill_t *collect_memphi(ss_env_t *env, ir_node *node) {
                        arg_spill = collect_memphi(env, arg);
                }
 
-               if(i == 0) {
+               if(res->cls == NULL) {
                        res->cls = arg_spill->cls;
                } else {
-                       assert(res->cls == arg_spill->cls);
+                       assert(arg_spill->cls == NULL || res->cls == arg_spill->cls);
                }
 
                // add an affinity edge
@@ -195,7 +195,7 @@ static void collect_spills_walker(ir_node *node, void *data) {
                ir_node *spillnode = get_memory_edge(node);
                spill_t *spill;
 
-               assert(spill != NULL);
+               assert(spillnode != NULL);
 
                if(is_Phi(spillnode)) {
                        spill = collect_memphi(env, spillnode);