This function can abort when called on a function_decl that is not a
member function. This patch addresses that issue.
* src/abg-ir.cc (function_decl::get_pretty_representation): Make
sure the function type is a member function before calling
get_member_function_is_{virtual,ctor,dtor,const}.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
string result = mem_fn ? "method ": "function ";
- if (get_member_function_is_virtual(mem_fn))
+ if (mem_fn
+ && is_member_function(mem_fn)
+ && get_member_function_is_virtual(mem_fn))
result += "virtual ";
decl_base_sptr type;
- if ((mem_fn && (get_member_function_is_dtor(*mem_fn)
- || get_member_function_is_ctor(*mem_fn))))
+ if ((mem_fn
+ && is_member_function(mem_fn)
+ && (get_member_function_is_dtor(*mem_fn)
+ || get_member_function_is_ctor(*mem_fn))))
/*cdtors do not have return types. */;
else
type = mem_fn
}
result += ")";
- if (mem_fn && get_member_function_is_const(*mem_fn))
+ if (mem_fn
+ && is_member_function(mem_fn)
+ && get_member_function_is_const(*mem_fn))
result += " const";
return result;