diff options
author | Simon Pilgrim <llvm-dev@redking.me.uk> | 2022-02-10 20:44:19 +0000 |
---|---|---|
committer | Simon Pilgrim <llvm-dev@redking.me.uk> | 2022-02-10 20:44:25 +0000 |
commit | 46359424bb2d6eb04508227d6c8ba433298b0ab9 (patch) | |
tree | 2920f6c6eeaa890e91f6c874162b9882dde98331 /llvm/tools/llvm-libtool-darwin/llvm-libtool-darwin.cpp | |
parent | 6af7c1371abf551389457b9ccb4ce50d8de2c7ea (diff) | |
download | llvm-46359424bb2d6eb04508227d6c8ba433298b0ab9.zip llvm-46359424bb2d6eb04508227d6c8ba433298b0ab9.tar.gz llvm-46359424bb2d6eb04508227d6c8ba433298b0ab9.tar.bz2 |
[llvm-libtool-darwin] Use cast<> instead of dyn_cast<> to avoid dereference of nullptr
The pointer is dereferenced immediately, so assert the cast is correct instead of returning nullptr
Diffstat (limited to 'llvm/tools/llvm-libtool-darwin/llvm-libtool-darwin.cpp')
-rw-r--r-- | llvm/tools/llvm-libtool-darwin/llvm-libtool-darwin.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/tools/llvm-libtool-darwin/llvm-libtool-darwin.cpp b/llvm/tools/llvm-libtool-darwin/llvm-libtool-darwin.cpp index 0c429c0..591a884 100644 --- a/llvm/tools/llvm-libtool-darwin/llvm-libtool-darwin.cpp +++ b/llvm/tools/llvm-libtool-darwin/llvm-libtool-darwin.cpp @@ -364,7 +364,7 @@ private: "'%s': format not supported", Member.MemberName.data()); - auto *O = dyn_cast<MachOObjectFile>(ObjOrErr->get()); + auto *O = cast<MachOObjectFile>(ObjOrErr->get()); uint32_t FileCPUType, FileCPUSubtype; std::tie(FileCPUType, FileCPUSubtype) = MachO::getCPUTypeFromArchitecture( MachO::getArchitectureFromName(O->getArchTriple().getArchName())); |