[PATCH] D19627: [scan-build] fix logic error warning emitted on compiler-rt code base

Apelete Seketeli via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 27 14:46:03 PDT 2016


apelete created this revision.
apelete added a reviewer: kcc.
apelete added a subscriber: llvm-commits.
Herald added a subscriber: kubabrecka.

Fix a "called c++ object pointer is null" warning emitted by Clang
Static Analyzer on the following file:
- lib/asan/asan_suppressions.cc.

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

http://reviews.llvm.org/D19627

Files:
  lib/asan/asan_suppressions.cc

Index: lib/asan/asan_suppressions.cc
===================================================================
--- lib/asan/asan_suppressions.cc
+++ lib/asan/asan_suppressions.cc
@@ -18,6 +18,7 @@
 #include "sanitizer_common/sanitizer_placement_new.h"
 #include "sanitizer_common/sanitizer_suppressions.h"
 #include "sanitizer_common/sanitizer_symbolizer.h"
+#include <assert.h>
 
 namespace __asan {
 
@@ -89,6 +90,7 @@
 
     if (suppression_ctx->HasSuppressionType(kInterceptorViaFunction)) {
       SymbolizedStack *frames = symbolizer->SymbolizePC(addr);
+      assert(frames && "does not point to any symbolized frames");
       for (SymbolizedStack *cur = frames; cur; cur = cur->next) {
         const char *function_name = cur->info.function;
         if (!function_name) {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D19627.55329.patch
Type: text/x-patch
Size: 777 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160427/f3e98fa7/attachment-0001.bin>


More information about the llvm-commits mailing list