summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-03-15 04:40:24 +0000
committerChris Lattner <sabre@nondot.org>2005-03-15 04:40:24 +0000
commit28f1caa63918034885a494defdadf8ca8d1ea863 (patch)
treea93f50d5422e373e79c5aa428ba83bfb36ca4482
parent26415d743286b58c190a811cf4ae21c116e1c81b (diff)
downloadbcm5719-llvm-28f1caa63918034885a494defdadf8ca8d1ea863.tar.gz
bcm5719-llvm-28f1caa63918034885a494defdadf8ca8d1ea863.zip
Don't crash if computing a mapping to a node with zero size
llvm-svn: 20595
-rw-r--r--llvm/lib/Analysis/DataStructure/DataStructure.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/Analysis/DataStructure/DataStructure.cpp b/llvm/lib/Analysis/DataStructure/DataStructure.cpp
index a73a942fc7e..a94e083da3f 100644
--- a/llvm/lib/Analysis/DataStructure/DataStructure.cpp
+++ b/llvm/lib/Analysis/DataStructure/DataStructure.cpp
@@ -2075,6 +2075,8 @@ void DSGraph::computeNodeMapping(const DSNodeHandle &NH1,
// mapping the edges together now.
int N2Idx = NH2.getOffset()-NH1.getOffset();
unsigned N2Size = N2->getSize();
+ if (N2Size == 0) return; // No edges to map to.
+
for (unsigned i = 0, e = N1->getSize(); i < e; i += DS::PointerSize)
if (unsigned(N2Idx)+i < N2Size)
computeNodeMapping(N1->getLink(i), N2->getLink(N2Idx+i), NodeMap);
OpenPOWER on IntegriCloud