projects
/
platform
/
upstream
/
llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0e10003
)
XCOFFObjectWriter - silence static analyzer dyn_cast<> null dereference warning....
author
Simon Pilgrim
<llvm-dev@redking.me.uk>
Mon, 14 Oct 2019 16:46:11 +0000
(16:46 +0000)
committer
Simon Pilgrim
<llvm-dev@redking.me.uk>
Mon, 14 Oct 2019 16:46:11 +0000
(16:46 +0000)
The static analyzer is warning about a potential null dereference, but we should be able to use cast<> directly and if not assert will fire for us.
llvm-svn: 374788
llvm/lib/MC/XCOFFObjectWriter.cpp
patch
|
blob
|
history
diff --git
a/llvm/lib/MC/XCOFFObjectWriter.cpp
b/llvm/lib/MC/XCOFFObjectWriter.cpp
index
5d8735b
..
dbea118
100644
(file)
--- a/
llvm/lib/MC/XCOFFObjectWriter.cpp
+++ b/
llvm/lib/MC/XCOFFObjectWriter.cpp
@@
-218,7
+218,7
@@
void XCOFFObjectWriter::executePostLayoutBinding(
DenseMap<const MCSectionXCOFF *, ControlSection *> WrapperMap;
for (const auto &S : Asm) {
- const
MCSectionXCOFF *MCSec = dyn_
cast<const MCSectionXCOFF>(&S);
+ const
auto *MCSec =
cast<const MCSectionXCOFF>(&S);
assert(WrapperMap.find(MCSec) == WrapperMap.end() &&
"Cannot add a csect twice.");