forked from OSchip/llvm-project
Don't crash if computing a mapping to a node with zero size
llvm-svn: 20595
This commit is contained in:
parent
26415d7432
commit
28f1caa639
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue