summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorVictor Hernandez <vhernandez@apple.com>2009-12-04 18:29:23 +0000
committerVictor Hernandez <vhernandez@apple.com>2009-12-04 18:29:23 +0000
commita6bd3f5f5eb1cf79786d75854ad0114b6f42772e (patch)
tree86b1181d06eb01b029e312d8b8a8ed7ce4576c42 /llvm/lib
parent19462d681a83ba18048922d2ea81c9620423296f (diff)
downloadbcm5719-llvm-a6bd3f5f5eb1cf79786d75854ad0114b6f42772e.tar.gz
bcm5719-llvm-a6bd3f5f5eb1cf79786d75854ad0114b6f42772e.zip
Fix crasher when N->getElement(n) is NULL
llvm-svn: 90572
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/VMCore/AsmWriter.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/VMCore/AsmWriter.cpp b/llvm/lib/VMCore/AsmWriter.cpp
index 1865402a65f..44095ca4e85 100644
--- a/llvm/lib/VMCore/AsmWriter.cpp
+++ b/llvm/lib/VMCore/AsmWriter.cpp
@@ -698,7 +698,7 @@ void SlotTracker::processFunction() {
if (MDNode *N = dyn_cast_or_null<MDNode>(I->getOperand(i))) {
// Create a metadata slot only if N contains no instructions.
for (unsigned n = 0, e = N->getNumElements(); n != e; ++n)
- if (isa<Instruction>(N->getElement(n)))
+ if (N->getElement(n) && isa<Instruction>(N->getElement(n)))
continue;
CreateMetadataSlot(N);
}
OpenPOWER on IntegriCloud