]> granicus.if.org Git - llvm/commitdiff
Initialize the RelocationSectionBase::Section member.
authorJames Y Knight <jyknight@google.com>
Tue, 26 Sep 2017 22:44:01 +0000 (22:44 +0000)
committerJames Y Knight <jyknight@google.com>
Tue, 26 Sep 2017 22:44:01 +0000 (22:44 +0000)
In r314227, it wasn't always, and would thus contain random garbage.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314256 91177308-0d34-0410-b5e6-96231b3b80d8

tools/llvm-objcopy/Object.cpp

index cb7fddeee77c83cd73db6739a1c7d7ebecb875e3..103937eaac94c9b79a9b4f7b828439df705b27be 100644 (file)
@@ -218,6 +218,8 @@ void RelocationSectionBase<SymTabType>::initialize(SectionTableRef SecTable) {
     setSection(SecTable.getSection(Info,
                                    "Info field value " + Twine(Info) +
                                        " in section " + Name + " is invalid"));
+  else
+    setSection(nullptr);
 }
 
 template <class SymTabType> void RelocationSectionBase<SymTabType>::finalize() {