use xmalloc instead of malloc
[libfirm] / ir / ir / irgopt.c
index e2d6332..53829b5 100644 (file)
@@ -900,7 +900,7 @@ static int can_inline(ir_node *call, ir_graph *called_graph)
 int inline_method(ir_node *call, ir_graph *called_graph) {
   ir_node *pre_call;
   ir_node *post_call, *post_bl;
-  ir_node *in[5];
+  ir_node *in[pn_Start_max];
   ir_node *end, *end_bl;
   ir_node **res_pred;
   ir_node **cf_pred;
@@ -983,14 +983,16 @@ int inline_method(ir_node *call, ir_graph *called_graph) {
      graph. Both will end up being a tuple.  -- */
   post_bl = get_nodes_block(call);
   set_irg_current_block(current_ir_graph, post_bl);
-  /* XxMxPxP of Start + parameter of Call */
-  in[pn_Start_X_initial_exec] = new_Jmp();
-  in[pn_Start_M]              = get_Call_mem(call);
-  in[pn_Start_P_frame_base]   = get_irg_frame(current_ir_graph);
-  in[pn_Start_P_globals]      = get_irg_globals(current_ir_graph);
-  in[pn_Start_T_args]         = new_Tuple(get_Call_n_params(call), get_Call_param_arr(call));
+  /* XxMxPxPxPxT of Start + parameter of Call */
+  in[pn_Start_X_initial_exec]   = new_Jmp();
+  in[pn_Start_M]                = get_Call_mem(call);
+  in[pn_Start_P_frame_base]     = get_irg_frame(current_ir_graph);
+  in[pn_Start_P_globals]        = get_irg_globals(current_ir_graph);
+  in[pn_Start_P_tls]            = get_irg_tls(current_ir_graph);
+  in[pn_Start_T_args]           = new_Tuple(get_Call_n_params(call), get_Call_param_arr(call));
   /* in[pn_Start_P_value_arg_base] = ??? */
-  pre_call = new_Tuple(5, in);
+  assert(pn_Start_P_value_arg_base == pn_Start_max - 1 && "pn_Start_P_value_arg_base not supported, fix");
+  pre_call = new_Tuple(pn_Start_max - 1, in);
   post_call = call;
 
   /* --