Fix logic of type suppression evaluation

* include/abg-comparison.cc (type_suppression::suppresses_diff):
	Try to evaluate the "type_name_regexp" property only if the
	"type_name" is empty.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
This commit is contained in:
Dodji Seketeli 2014-11-01 11:46:26 +01:00
parent 3816b22e6f
commit ad9c8a1b61

View File

@ -522,19 +522,22 @@ type_suppression::suppresses_diff(const diff* diff) const
if (get_type_name() != fn && get_type_name() != sn)
return false;
}
// So now check if there is a regular expression match.
//
// If none of the qualified name of the types that are being
// compared match the regular expression of the of the type name,
// then this suppression doesn't apply.
const sptr_utils::regex_t_sptr type_name_regex = priv_->get_type_name_regex();
if (type_name_regex
&& (regexec(type_name_regex.get(), fn.c_str(),
0, NULL, 0) != 0
&& regexec(type_name_regex.get(), sn.c_str(),
0, NULL, 0) != 0))
return false;
else
{
// So now check if there is a regular expression match.
//
// If none of the qualified name of the types that are being
// compared match the regular expression of the of the type name,
// then this suppression doesn't apply.
const sptr_utils::regex_t_sptr type_name_regex =
priv_->get_type_name_regex();
if (type_name_regex
&& (regexec(type_name_regex.get(), fn.c_str(),
0, NULL, 0) != 0
&& regexec(type_name_regex.get(), sn.c_str(),
0, NULL, 0) != 0))
return false;
}
return true;
}