aboutsummaryrefslogtreecommitdiffstats
path: root/lib/VMCore/AsmWriter.cpp
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
commitabf657c53cc476649c440c08edc622f71cbc61ba (patch)
tree0726e45a511a0405cc76c87e3498ee1970d5e219 /lib/VMCore/AsmWriter.cpp
parent371fcef75743c634263720bcd3a61a1615b90163 (diff)
downloadexternal_llvm-abf657c53cc476649c440c08edc622f71cbc61ba.zip
external_llvm-abf657c53cc476649c440c08edc622f71cbc61ba.tar.gz
external_llvm-abf657c53cc476649c440c08edc622f71cbc61ba.tar.bz2
Fix crasher when N->getElement(n) is NULL
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90572 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore/AsmWriter.cpp')
-rw-r--r--lib/VMCore/AsmWriter.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/VMCore/AsmWriter.cpp b/lib/VMCore/AsmWriter.cpp
index 1865402..44095ca 100644
--- a/lib/VMCore/AsmWriter.cpp
+++ b/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);
}