summaryrefslogtreecommitdiff
path: root/lib
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
commitc1f354dcb82e2365a5fd1c39f11199dd2344cfb8 (patch)
treeeb3c3c349a98c5df8a539103e572b8e486de026c /lib
parent9778a8af2335478926dd0aa929deb034333a031e (diff)
downloadllvm-c1f354dcb82e2365a5fd1c39f11199dd2344cfb8.tar.gz
llvm-c1f354dcb82e2365a5fd1c39f11199dd2344cfb8.tar.bz2
llvm-c1f354dcb82e2365a5fd1c39f11199dd2344cfb8.tar.xz
MC/MachO: Fix possible null pointer dereference.
Discovered by Microsoft Visual Studio 2010 Code Analysis. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110575 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/MC/MachObjectWriter.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/MC/MachObjectWriter.cpp b/lib/MC/MachObjectWriter.cpp
index 7ca09511bd..d67dbc01e6 100644
--- a/lib/MC/MachObjectWriter.cpp
+++ b/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;