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
127d1184
Commit
127d1184
authored
Oct 20, 2011
by
Matthias Braun
Browse files
assert that no hook_entry is registered twice
parent
f6b78c1b
Changes
2
Hide whitespace changes
Inline
Side-by-side
ir/ir/irdump.c
View file @
127d1184
...
...
@@ -1124,7 +1124,7 @@ static void dump_node_vcgattr(FILE *F, ir_node *node, ir_node *local, int bad)
void
*
dump_add_node_info_callback
(
dump_node_info_cb_t
*
cb
,
void
*
data
)
{
hook_entry_t
*
info
=
XMALLOC
(
hook_entry_t
);
hook_entry_t
*
info
=
XMALLOC
Z
(
hook_entry_t
);
info
->
hook
.
_hook_node_info
=
cb
;
info
->
context
=
data
;
...
...
ir/ir/irhooks.c
View file @
127d1184
...
...
@@ -25,6 +25,8 @@
*/
#include "config.h"
#include <assert.h>
#include "irhooks.h"
/* the hooks */
...
...
@@ -37,6 +39,9 @@ void register_hook(hook_type_t hook, hook_entry_t *entry)
if
(
!
entry
->
hook
.
_hook_turn_into_id
)
return
;
/* hook should not be registered yet */
assert
(
entry
->
next
==
NULL
&&
hooks
[
hook
]
!=
entry
);
entry
->
next
=
hooks
[
hook
];
hooks
[
hook
]
=
entry
;
}
...
...
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