summaryrefslogtreecommitdiffstats
path: root/lld/lib/Driver/GnuLdInputGraph.cpp
diff options
context:
space:
mode:
authorSimon Atanasyan <simon@atanasyan.com>2014-06-10 13:43:13 +0000
committerSimon Atanasyan <simon@atanasyan.com>2014-06-10 13:43:13 +0000
commit6790b14ebb846c75f8aab43f3194bea1f3094ab1 (patch)
tree9b04e19c382ba385216bc6511c10c0e37ca6a7ee /lld/lib/Driver/GnuLdInputGraph.cpp
parentecaba1799656d6ec91632e8100986be2d57319e7 (diff)
downloadbcm5719-llvm-6790b14ebb846c75f8aab43f3194bea1f3094ab1.tar.gz
bcm5719-llvm-6790b14ebb846c75f8aab43f3194bea1f3094ab1.zip
[ELF] Fix the bug -- LLD crashes if the --whole-archive option
is around non-archive. llvm-svn: 210530
Diffstat (limited to 'lld/lib/Driver/GnuLdInputGraph.cpp')
-rw-r--r--lld/lib/Driver/GnuLdInputGraph.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lld/lib/Driver/GnuLdInputGraph.cpp b/lld/lib/Driver/GnuLdInputGraph.cpp
index a3c6543e125..febc737d1b5 100644
--- a/lld/lib/Driver/GnuLdInputGraph.cpp
+++ b/lld/lib/Driver/GnuLdInputGraph.cpp
@@ -32,7 +32,7 @@ error_code ELFFileNode::parse(const LinkingContext &ctx,
return ec;
assert(parsedFiles.size() == 1);
std::unique_ptr<File> f(parsedFiles[0].release());
- if (auto archive = reinterpret_cast<const ArchiveLibraryFile *>(f.get())) {
+ if (const auto *archive = dyn_cast<ArchiveLibraryFile>(f.get())) {
// Have this node own the FileArchive object.
_archiveFile.reset(archive);
f.release();
OpenPOWER on IntegriCloud