Harden class_decl node traversal code

* src/abg-ir.cc (class_decl::traverse): Add a few asserts here and there.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
This commit is contained in:
Dodji Seketeli 2014-02-11 16:20:18 +01:00
parent 2c3dbbdb62
commit f6425bc936

View File

@ -3198,8 +3198,8 @@ class_decl::traverse(ir_node_visitor& v)
{
ir_traversable_base_sptr t =
dynamic_pointer_cast<ir_traversable_base>(*i);
if (t)
t->traverse(v);
assert(t);
t->traverse(v);
}
for (member_function_templates::const_iterator i =
@ -3209,8 +3209,8 @@ class_decl::traverse(ir_node_visitor& v)
{
ir_traversable_base_sptr t =
dynamic_pointer_cast<ir_traversable_base>(*i);
if (t)
t->traverse(v);
assert(t);
t->traverse(v);
}
for (member_class_templates::const_iterator i =
@ -3220,8 +3220,8 @@ class_decl::traverse(ir_node_visitor& v)
{
ir_traversable_base_sptr t =
dynamic_pointer_cast<ir_traversable_base>(*i);
if (t)
t->traverse(v);
assert(t);
t->traverse(v);
}
for (data_members::const_iterator i = get_data_members().begin();
@ -3230,8 +3230,8 @@ class_decl::traverse(ir_node_visitor& v)
{
ir_traversable_base_sptr t =
dynamic_pointer_cast<ir_traversable_base>(*i);
if (t)
t->traverse(v);
assert(t);
t->traverse(v);
}
for (member_functions::const_iterator i= get_member_functions().begin();
@ -3240,8 +3240,8 @@ class_decl::traverse(ir_node_visitor& v)
{
ir_traversable_base_sptr t =
dynamic_pointer_cast<ir_traversable_base>(*i);
if (t)
t->traverse(v);
assert(t);
t->traverse(v);
}
}