# include "xmalloc.h"
# include "pto_debug.h"
+# include "gnu_ext.h"
/* Local Defines: */
# ifndef TRUE
{
type *tp = get_entity_type (get_irg_entity (graph));
const int n_args = get_method_n_params (tp);
- ir_node **args = xcalloc (n_args + 1, sizeof(args[0]));
+ ir_node **args = xcalloc (n_args + 1, sizeof (ir_node*));
ir_node *arg = get_irg_args (graph);
- find_irg_args_env_t arg_env;
+ find_irg_args_env_t *arg_env;
- arg_env.args = args;
- arg_env.arg = arg;
+ arg_env = (find_irg_args_env_t*) xmalloc (sizeof (find_irg_args_env_t));
+
+ arg_env->args = args;
+ arg_env->arg = arg;
{
ir_graph *save = get_current_ir_graph ();
set_current_ir_graph (graph);
- irg_walk (get_irg_end (graph), find_irg_arg, NULL, &arg_env);
+ irg_walk (get_irg_end (graph), find_irg_arg, NULL, arg_env);
set_current_ir_graph (save);
}
+ memset (arg_env, 0x00, sizeof (find_irg_args_env_t));
+ free (arg_env);
+
args [n_args] = NULL;
return (args);
} break;
default: {
- fprintf (stderr, "get_ptr_ent: no ent for ptr=%s[%ld]\n",
+ fprintf (stderr, "%s: no ent for ptr=%s[%ld]\n",
+ __FUNCTION__,
get_op_name (get_irn_op (ptr)),
get_irn_node_nr (ptr));
assert (0);
\f
/*
$Log$
+ Revision 1.16 2005/01/14 14:13:32 liekweg
+ fix gnu extension
+
+ Revision 1.15 2005/01/10 17:26:34 liekweg
+ fixup printfs, don't put environments on the stack
+
Revision 1.14 2004/12/23 15:47:09 beck
removed uneeded allocations
used new xcalloc