aboutsummaryrefslogtreecommitdiff
path: root/contrib/llvm-project/lld/COFF/InputFiles.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/llvm-project/lld/COFF/InputFiles.cpp')
-rw-r--r--contrib/llvm-project/lld/COFF/InputFiles.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/contrib/llvm-project/lld/COFF/InputFiles.cpp b/contrib/llvm-project/lld/COFF/InputFiles.cpp
index 541837a7fcec..a7a08fb2fa6e 100644
--- a/contrib/llvm-project/lld/COFF/InputFiles.cpp
+++ b/contrib/llvm-project/lld/COFF/InputFiles.cpp
@@ -661,6 +661,8 @@ std::optional<Symbol *> ObjFile::createDefined(
if (prevailing) {
SectionChunk *c = readSection(sectionNumber, def, getName());
sparseChunks[sectionNumber] = c;
+ if (!c)
+ return nullptr;
c->sym = cast<DefinedRegular>(leader);
c->selection = selection;
cast<DefinedRegular>(leader)->data = &c->repl;