From: Chris Lattner Date: Tue, 15 Mar 2005 04:40:24 +0000 (+0000) Subject: Don't crash if computing a mapping to a node with zero size X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=841957ebaf0fffba1574a4ea5df7188753ea51ac;p=oota-llvm.git Don't crash if computing a mapping to a node with zero size git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20595 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Analysis/DataStructure/DataStructure.cpp b/lib/Analysis/DataStructure/DataStructure.cpp index a73a942fc7e..a94e083da3f 100644 --- a/lib/Analysis/DataStructure/DataStructure.cpp +++ b/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);