analyzer: fix more pointer-printing in logs

gcc/analyzer/ChangeLog:
	* program-state.cc (sm_state_map::print): Guard the printing of
	the origin pointer with !flag_dump_noaddr.
	* region.cc (string_region::dump_to_pp): Likewise for
	m_string_cst.
This commit is contained in:
David Malcolm 2020-10-28 20:07:35 -04:00
parent f4f9364d20
commit 0a36f5f21c
2 changed files with 11 additions and 5 deletions

View File

@ -224,8 +224,11 @@ sm_state_map::print (const region_model *model,
if (e.m_origin)
{
pp_string (pp, " (origin: ");
pp_pointer (pp, e.m_origin);
pp_string (pp, ": ");
if (!flag_dump_noaddr)
{
pp_pointer (pp, e.m_origin);
pp_string (pp, ": ");
}
e.m_origin->dump_to_pp (pp, simple);
if (model)
if (tree rep = model->get_representative_tree (e.m_origin))

View File

@ -1135,9 +1135,12 @@ string_region::dump_to_pp (pretty_printer *pp, bool simple) const
{
pp_string (pp, "string_region(");
dump_tree (pp, m_string_cst);
pp_string (pp, " (");
pp_pointer (pp, m_string_cst);
pp_string (pp, "))");
if (!flag_dump_noaddr)
{
pp_string (pp, " (");
pp_pointer (pp, m_string_cst);
pp_string (pp, "))");
}
}
}