[turbofan] Fixed segmentation fault while printing TurboFan node

Graph trimmer can set Input as null and subsequent
printing call could cause segmentation fault.

R=bmeurer@chromium.org, jarin@chromium.org

Review-Url: https://codereview.chromium.org/2134443002
Cr-Commit-Position: refs/heads/master@{#37658}
This commit is contained in:
diaoyuanjie 2016-07-11 13:41:09 -07:00 committed by Commit bot
parent 992e34c216
commit 1d26ed290b
2 changed files with 6 additions and 1 deletions

View File

@ -52,6 +52,7 @@ Chris Nardi <hichris123@gmail.com>
Christopher A. Taylor <chris@gameclosure.com>
Daniel Andersson <kodandersson@gmail.com>
Daniel James <dnljms@gmail.com>
Deon Dior <diaoyuanjie@gmail.com>
Douglas Crosher <dtc-v8@scieneer.com>
Dusan Milosavljevic <dusan.m.milosavljevic@gmail.com>
Erich Ocean <erich.ocean@me.com>

View File

@ -369,7 +369,11 @@ std::ostream& operator<<(std::ostream& os, const Node& n) {
os << "(";
for (int i = 0; i < n.InputCount(); ++i) {
if (i != 0) os << ", ";
os << n.InputAt(i)->id();
if (n.InputAt(i)) {
os << n.InputAt(i)->id();
} else {
os << "null";
}
}
os << ")";
}