Refactor Varnode printRaw

This commit is contained in:
caheckman 2021-01-07 15:13:41 -05:00
parent 5f715d73e3
commit 3bfcb95788
4 changed files with 75 additions and 64 deletions

View file

@ -634,10 +634,6 @@ int4 Varnode::printRawNoMarkup(ostream &s) const
void Varnode::printRaw(ostream &s) const
{
if (this == (const Varnode *)0) {
s << "<null>";
return;
}
int4 expect = printRawNoMarkup(s);
if (expect != size)
@ -836,6 +832,20 @@ void Varnode::saveXml(ostream &s) const
s << "/>";
}
/// Invoke the printRaw method on the given Varnode pointer, but take into account that it
/// might be null.
/// \param s is the output stream to write to
/// \param vn is the given Varnode pointer (may be null)
void Varnode::printRaw(ostream &s,const Varnode *vn)
{
if (vn == (const Varnode *)0) {
s << "<null>";
return;
}
vn->printRaw(s);
}
/// \param m is the underlying address space manager
/// \param uspace is the \e unique space
/// \param ubase is the base offset for allocating temporaries