[PATCH] D19970: [scan-build] fix warnings emitted on LLVM MachineCode code baseFix logic error warnings of the type "called C++ object pointer isnull" emitted by Clang Static Analyzer on the following file:- lib/MC/MCParser/AsmParser.cpp.

Apelete Seketeli via llvm-commits llvm-commits at lists.llvm.org
Thu May 5 06:44:01 PDT 2016


apelete created this revision.
apelete added reviewers: grosbach, rafael.
apelete added a subscriber: llvm-commits.

Signed-off-by: Apelete Seketeli <apelete at seketeli.net>

http://reviews.llvm.org/D19970

Files:
  lib/MC/MCParser/AsmParser.cpp

Index: lib/MC/MCParser/AsmParser.cpp
===================================================================
--- lib/MC/MCParser/AsmParser.cpp
+++ lib/MC/MCParser/AsmParser.cpp
@@ -657,7 +657,7 @@
   // section and generate a .file directive.
   if (getContext().getGenDwarfForAssembly()) {
     MCSection *Sec = getStreamer().getCurrentSection().first;
-    if (!Sec->getBeginSymbol()) {
+    if (Sec && !Sec->getBeginSymbol()) {
       MCSymbol *SectionStartSym = getContext().createTempSymbol();
       getStreamer().EmitLabel(SectionStartSym);
       Sec->setBeginSymbol(SectionStartSym);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D19970.56278.patch
Type: text/x-patch
Size: 589 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160505/885f7b83/attachment.bin>


More information about the llvm-commits mailing list