Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Zwinkau
libfirm
Commits
0ecb06af
Commit
0ecb06af
authored
Oct 24, 2011
by
Matthias Braun
Browse files
heights: fix usage of uninitialized memory
parent
e0fc2155
Changes
1
Hide whitespace changes
Inline
Side-by-side
ir/ana/heights.c
View file @
0ecb06af
...
...
@@ -62,8 +62,7 @@ static irn_height_t *get_height_data(ir_heights_t *heights, const ir_node *node)
{
irn_height_t
*
height
=
(
irn_height_t
*
)
ir_nodemap_get
(
&
heights
->
data
,
node
);
if
(
height
==
NULL
)
{
height
=
obstack_alloc
(
&
heights
->
obst
,
sizeof
(
*
height
));
memset
(
height
,
0
,
sizeof
(
*
height
));
height
=
OALLOCZ
(
&
heights
->
obst
,
irn_height_t
);
ir_nodemap_insert
(
&
heights
->
data
,
node
,
height
);
}
return
height
;
...
...
@@ -247,7 +246,7 @@ unsigned heights_recompute_block(ir_heights_t *h, ir_node *block)
ir_heights_t
*
heights_new
(
ir_graph
*
irg
)
{
ir_heights_t
*
res
=
XMALLOC
(
ir_heights_t
);
ir_heights_t
*
res
=
XMALLOC
Z
(
ir_heights_t
);
ir_nodemap_init
(
&
res
->
data
,
irg
);
obstack_init
(
&
res
->
obst
);
res
->
dump_handle
=
dump_add_node_info_callback
(
height_dump_cb
,
res
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment