Several of the dead-statement type elision passes temporarily
substitute 0 pointers for actual staptree nodes. If coupled with
-vvvv pretty-printing, these 0's had a way of triggering segvs.
Now more of these pretty-printers explicitly test for 0.
void expr_statement::print (ostream& o) const
{
- o << *value;
+ if (value)
+ o << *value;
+ else
+ o << ";"; /* mid-elision-pass null-statement */
}
void if_statement::print (ostream& o) const
{
- o << "if (" << *condition << ") "
- << *thenblock << endl;
+ o << "if (" << *condition << ") ";
+ if (thenblock) o << *thenblock; else o << ";"; o << endl;
if (elseblock)
o << "else " << *elseblock << endl;
}
if (this->verbose > 3)
{
std::clog << _("replaced ");
- old_src->print(std::clog);
+ if (old_src) old_src->print(std::clog); else std::clog << "0";
std::clog << _(" with ");
- new_src->print(std::clog);
+ if (new_src) new_src->print(std::clog); else std::clog << "0";
std::clog << std::endl;
}
relaxed_p = false;
-#! stap -Wp4
+#! stap -Wvvvvp4
probe syscall.accept
{