summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC/MachObjectWriter.cpp
diff options
context:
space:
mode:
authorMichael J. Spencer <bigcheesegs@gmail.com>2010-08-09 15:28:05 +0000
committerMichael J. Spencer <bigcheesegs@gmail.com>2010-08-09 15:28:05 +0000
commit4a5167c836b09f26567050492acbf65b843754d7 (patch)
tree71eae2e4b7df5534dc6fdc49a1b41c1ff0569848 /llvm/lib/MC/MachObjectWriter.cpp
parentcc4a9670d3f24ede7a4270c30115ff7970f6d094 (diff)
downloadbcm5719-llvm-4a5167c836b09f26567050492acbf65b843754d7.tar.gz
bcm5719-llvm-4a5167c836b09f26567050492acbf65b843754d7.zip
MC/MachO: Fix possible null pointer dereference.
Discovered by Microsoft Visual Studio 2010 Code Analysis. llvm-svn: 110575
Diffstat (limited to 'llvm/lib/MC/MachObjectWriter.cpp')
-rw-r--r--llvm/lib/MC/MachObjectWriter.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/MC/MachObjectWriter.cpp b/llvm/lib/MC/MachObjectWriter.cpp
index 7ca09511bde..d67dbc01e61 100644
--- a/llvm/lib/MC/MachObjectWriter.cpp
+++ b/llvm/lib/MC/MachObjectWriter.cpp
@@ -835,7 +835,7 @@ public:
// FIXME: Currently, these are never generated (see code below). I cannot
// find a case where they are actually emitted.
Type = RIT_Vanilla;
- } else {
+ } else if (SD) {
// Check whether we need an external or internal relocation.
if (doesSymbolRequireExternRelocation(SD)) {
IsExtern = 1;
OpenPOWER on IntegriCloud