[llvm-commits] CVS: llvm/lib/Analysis/DataStructure/DataStructure.cpp
Chris Lattner
lattner at cs.uiuc.edu
Mon Mar 14 20:40:40 PST 2005
Changes in directory llvm/lib/Analysis/DataStructure:
DataStructure.cpp updated: 1.201 -> 1.202
---
Log message:
Don't crash if computing a mapping to a node with zero size
---
Diffs of the changes: (+2 -0)
DataStructure.cpp | 2 ++
1 files changed, 2 insertions(+)
Index: llvm/lib/Analysis/DataStructure/DataStructure.cpp
diff -u llvm/lib/Analysis/DataStructure/DataStructure.cpp:1.201 llvm/lib/Analysis/DataStructure/DataStructure.cpp:1.202
--- llvm/lib/Analysis/DataStructure/DataStructure.cpp:1.201 Mon Mar 14 18:58:16 2005
+++ llvm/lib/Analysis/DataStructure/DataStructure.cpp Mon Mar 14 22:40:24 2005
@@ -2075,6 +2075,8 @@
// 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);
More information about the llvm-commits
mailing list