summaryrefslogtreecommitdiff
path: root/lld/COFF/InputFiles.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2023-10-21 13:28:43 +0000
committerDimitry Andric <dim@FreeBSD.org>2023-10-21 13:28:43 +0000
commitcd255c5cf2441442b46200d298c0cbccf83caba5 (patch)
tree1da148a900113b0ece7fafd2a306265bbcff1861 /lld/COFF/InputFiles.cpp
parent7d1b50167725e83cd4b07401b6916b7f0b6919f1 (diff)
Vendor import of llvm-project branch release/17.x llvmorg-17.0.3-0-g888437e1b600.vendor/llvm-project/llvmorg-17.0.3-0-g888437e1b600
Diffstat (limited to 'lld/COFF/InputFiles.cpp')
-rw-r--r--lld/COFF/InputFiles.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/lld/COFF/InputFiles.cpp b/lld/COFF/InputFiles.cpp
index 541837a7fcec..a7a08fb2fa6e 100644
--- a/lld/COFF/InputFiles.cpp
+++ b/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;