summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
diff options
context:
space:
mode:
authorRenato Golin <renato.golin@linaro.org>2016-05-12 12:33:33 +0000
committerRenato Golin <renato.golin@linaro.org>2016-05-12 12:33:33 +0000
commitf6ed8bbf468948336c6d9291f9de156820dd8be2 (patch)
treea178dae3cca397b264ab6e50551a8faf7c320726 /llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
parent562a3c2b66b1e474e4e44b0417427f1394ee5dff (diff)
downloadbcm5719-llvm-f6ed8bbf468948336c6d9291f9de156820dd8be2.tar.gz
bcm5719-llvm-f6ed8bbf468948336c6d9291f9de156820dd8be2.zip
[scan-build] fix warnings emitted on LLVM ARM code base
Fix "Logic error" warnings of the type "Called C++ object pointer is null" reported by Clang Static Analyzer. Patch by Apelete Seketeli. llvm-svn: 269285
Diffstat (limited to 'llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp')
-rw-r--r--llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp b/llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
index 08d813b1424..1af898cf7e5 100644
--- a/llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
+++ b/llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
@@ -9961,7 +9961,9 @@ bool ARMAsmParser::parseDirectiveAlign(SMLoc L) {
return true;
// '.align' is target specifically handled to mean 2**2 byte alignment.
- if (getStreamer().getCurrentSection().first->UseCodeAlign())
+ const MCSection *Section = getStreamer().getCurrentSection().first;
+ assert(Section && "must have section to emit alignment");
+ if (Section->UseCodeAlign())
getStreamer().EmitCodeAlignment(4, 0);
else
getStreamer().EmitValueToAlignment(4, 0, 1, 0);
OpenPOWER on IntegriCloud