Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Unified Diff: src/IceCfgNode.cpp

Issue 1590303002: Subzero: Make optimizations more resilient for early Target development. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/IceCfg.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceCfgNode.cpp
diff --git a/src/IceCfgNode.cpp b/src/IceCfgNode.cpp
index 9e3f23adf634394616a2804d6da7f79530490304..f06e6312fbfa6341ea4688b5803fcda367767cb4 100644
--- a/src/IceCfgNode.cpp
+++ b/src/IceCfgNode.cpp
@@ -852,10 +852,16 @@ void CfgNode::contractIfEmpty() {
else if (!I.isRedundantAssign())
return;
}
+ // Make sure there is actually a successor to repoint in-edges to.
+ if (OutEdges.empty())
+ return;
assert(OutEdges.size() == 1);
// Don't try to delete a self-loop.
if (OutEdges[0] == this)
return;
+ // Make sure the node actually contains (ends with) an unconditional branch.
+ if (Branch == nullptr)
+ return;
Branch->setDeleted();
CfgNode *Successor = OutEdges.front();
« no previous file with comments | « src/IceCfg.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698