[PATCH] D19972: [scan-build] fix warnings emitted on LLVM dsymutil code base

Apelete Seketeli via llvm-commits llvm-commits at lists.llvm.org
Thu May 5 07:04:57 PDT 2016


apelete created this revision.
apelete added reviewers: dexonsmith, aprantl.
apelete added a subscriber: llvm-commits.

Fix a logic error warning of the type "called C++ object pointer is
null" emitted by Clang Static Analyzer on the following file:

- tools/dsymutil/DwarfLinker.cpp.

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

http://reviews.llvm.org/D19972

Files:
  tools/dsymutil/DwarfLinker.cpp

Index: tools/dsymutil/DwarfLinker.cpp
===================================================================
--- tools/dsymutil/DwarfLinker.cpp
+++ tools/dsymutil/DwarfLinker.cpp
@@ -2449,6 +2449,8 @@
   Attr = Loc ? static_cast<DIEValueList *>(Loc)
              : static_cast<DIEValueList *>(Block);
 
+  assert(Attr && "DIEValue list needs to be not NULL");
+
   if (Loc)
     Value = DIEValue(dwarf::Attribute(AttrSpec.Attr),
                      dwarf::Form(AttrSpec.Form), Loc);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D19972.56281.patch
Type: text/x-patch
Size: 483 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160505/6377d5f4/attachment.bin>


More information about the llvm-commits mailing list