diff options
author | Simon Pilgrim <llvm-dev@redking.me.uk> | 2019-10-02 11:48:32 +0000 |
---|---|---|
committer | Simon Pilgrim <llvm-dev@redking.me.uk> | 2019-10-02 11:48:32 +0000 |
commit | c9129cea27188a732fddcd6ce14960e3520486ca (patch) | |
tree | 17c9419283f9a858ed19e19ad595d18551938784 /llvm/lib/CodeGen/AsmPrinter/WinException.cpp | |
parent | 2bb217b5fec3e3b98c25a2d5d8d88f3a0b245a2c (diff) | |
download | bcm5719-llvm-c9129cea27188a732fddcd6ce14960e3520486ca.tar.gz bcm5719-llvm-c9129cea27188a732fddcd6ce14960e3520486ca.zip |
WinException::emitExceptHandlerTable - silence static analyzer dyn_cast<Function> null dereference warning. NFCI.
The static analyzer is warning about a potential null dereference, but we should be able to use cast<Function> directly and if not assert will fire for us.
llvm-svn: 373449
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/WinException.cpp')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/WinException.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/WinException.cpp b/llvm/lib/CodeGen/AsmPrinter/WinException.cpp index 155e91ce61a..0398675577c 100644 --- a/llvm/lib/CodeGen/AsmPrinter/WinException.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/WinException.cpp @@ -982,8 +982,7 @@ void WinException::emitExceptHandlerTable(const MachineFunction *MF) { OS.EmitValueToAlignment(4); OS.EmitLabel(LSDALabel); - const Function *Per = - dyn_cast<Function>(F.getPersonalityFn()->stripPointerCasts()); + const auto *Per = cast<Function>(F.getPersonalityFn()->stripPointerCasts()); StringRef PerName = Per->getName(); int BaseState = -1; if (PerName == "_except_handler4") { |