[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 23:41:46 PDT 2016


apelete updated this revision to Diff 55379.
apelete added a comment.

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

Changes since last revision:

- replace deprecated <assert.h> library by C++ <cassert> equivalent.


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 <cassert>
 
 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.55379.patch
Type: text/x-patch
Size: 776 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160428/e02e1185/attachment.bin>


More information about the llvm-commits mailing list