Commit 1d26ed29 authored by diaoyuanjie's avatar diaoyuanjie Committed by Commit bot

[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}
parent 992e34c2
...@@ -52,6 +52,7 @@ Chris Nardi <hichris123@gmail.com> ...@@ -52,6 +52,7 @@ Chris Nardi <hichris123@gmail.com>
Christopher A. Taylor <chris@gameclosure.com> Christopher A. Taylor <chris@gameclosure.com>
Daniel Andersson <kodandersson@gmail.com> Daniel Andersson <kodandersson@gmail.com>
Daniel James <dnljms@gmail.com> Daniel James <dnljms@gmail.com>
Deon Dior <diaoyuanjie@gmail.com>
Douglas Crosher <dtc-v8@scieneer.com> Douglas Crosher <dtc-v8@scieneer.com>
Dusan Milosavljevic <dusan.m.milosavljevic@gmail.com> Dusan Milosavljevic <dusan.m.milosavljevic@gmail.com>
Erich Ocean <erich.ocean@me.com> Erich Ocean <erich.ocean@me.com>
......
...@@ -369,7 +369,11 @@ std::ostream& operator<<(std::ostream& os, const Node& n) { ...@@ -369,7 +369,11 @@ std::ostream& operator<<(std::ostream& os, const Node& n) {
os << "("; os << "(";
for (int i = 0; i < n.InputCount(); ++i) { for (int i = 0; i < n.InputCount(); ++i) {
if (i != 0) os << ", "; if (i != 0) os << ", ";
os << n.InputAt(i)->id(); if (n.InputAt(i)) {
os << n.InputAt(i)->id();
} else {
os << "null";
}
} }
os << ")"; os << ")";
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment