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
de2ab604
Commit
de2ab604
authored
Jul 12, 2012
by
Christoph Mallon
Browse files
Do not access memory after the end of an object.
parent
93193708
Changes
2
Hide whitespace changes
Inline
Side-by-side
ir/adt/pmap.c
View file @
de2ab604
...
...
@@ -86,7 +86,8 @@ int pmap_contains(pmap *map, const void *key)
pmap_entry
*
pmap_find
(
pmap
*
map
,
const
void
*
key
)
{
return
(
pmap_entry
*
)
set_find
(
M2S
(
map
),
&
key
,
sizeof
(
pmap_entry
),
hash_ptr
(
key
));
pmap_entry
const
entry
=
{
key
,
0
};
return
(
pmap_entry
*
)
set_find
(
M2S
(
map
),
&
entry
,
sizeof
(
entry
),
hash_ptr
(
key
));
}
...
...
ir/stat/firmstat.c
View file @
de2ab604
...
...
@@ -961,7 +961,8 @@ static void update_node_stat_2(ir_node *node, void *env)
*/
static
unsigned
get_adr_mark
(
graph_entry_t
*
graph
,
ir_node
*
node
)
{
address_mark_entry_t
*
value
=
(
address_mark_entry_t
*
)
set_find
(
graph
->
address_mark
,
&
node
,
sizeof
(
*
value
),
hash_ptr
(
node
));
address_mark_entry_t
const
val
=
{
node
,
0
};
address_mark_entry_t
*
value
=
(
address_mark_entry_t
*
)
set_find
(
graph
->
address_mark
,
&
val
,
sizeof
(
val
),
hash_ptr
(
node
));
return
value
?
value
->
mark
:
0
;
}
/* get_adr_mark */
...
...
@@ -971,9 +972,8 @@ static unsigned get_adr_mark(graph_entry_t *graph, ir_node *node)
*/
static
void
set_adr_mark
(
graph_entry_t
*
graph
,
ir_node
*
node
,
unsigned
val
)
{
address_mark_entry_t
*
value
=
(
address_mark_entry_t
*
)
set_insert
(
graph
->
address_mark
,
&
node
,
sizeof
(
*
value
),
hash_ptr
(
node
));
value
->
mark
=
val
;
address_mark_entry_t
const
value
=
{
node
,
val
};
set_insert
(
graph
->
address_mark
,
&
value
,
sizeof
(
value
),
hash_ptr
(
node
));
}
/* set_adr_mark */
#undef DUMP_ADR_MODE
...
...
Write
Preview
Supports
Markdown
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