[clang] [analyzer] Remove some false negatives in StackAddrEscapeChecker (PR #125638)

LLVM Continuous Integration via cfe-commits cfe-commits at lists.llvm.org
Mon Feb 10 14:23:34 PST 2025


llvm-ci wrote:

LLVM Buildbot has detected a new failure on builder `clang-ppc64le-linux-test-suite` running on `ppc64le-clang-test-suite` while building `clang` at step 5 "build-unified-tree".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/95/builds/9457

<details>
<summary>Here is the relevant piece of the build log for the reference</summary>

```
Step 5 (build-unified-tree) failure: build (failure)
...
12.893 [60/26/59] Linking CXX executable bin/llvm-ar
12.903 [57/28/60] Generating ../../bin/llvm-ranlib
12.904 [57/27/61] Generating ../../bin/llvm-lib
12.904 [57/26/62] Generating ../../bin/llvm-dlltool
12.947 [57/25/63] Linking CXX executable bin/sancov
13.013 [57/24/64] Linking CXX executable bin/llvm-debuginfo-analyzer
13.173 [57/23/65] Linking CXX executable bin/llvm-nm
14.129 [57/22/66] Linking CXX executable bin/llvm-cfi-verify
14.923 [57/21/67] Linking CXX executable bin/llvm-profgen
15.091 [57/20/68] Building CXX object tools/clang/lib/StaticAnalyzer/Checkers/CMakeFiles/obj.clangStaticAnalyzerCheckers.dir/StackAddrEscapeChecker.cpp.o
FAILED: tools/clang/lib/StaticAnalyzer/Checkers/CMakeFiles/obj.clangStaticAnalyzerCheckers.dir/StackAddrEscapeChecker.cpp.o 
ccache /usr/lib64/ccache/c++ -DCLANG_EXPORTS -DGTEST_HAS_RTTI=0 -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-test-suite/clang-ppc64le-test-suite/build/tools/clang/lib/StaticAnalyzer/Checkers -I/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-test-suite/clang-ppc64le-test-suite/llvm-project/clang/lib/StaticAnalyzer/Checkers -I/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-test-suite/clang-ppc64le-test-suite/llvm-project/clang/include -I/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-test-suite/clang-ppc64le-test-suite/build/tools/clang/include -I/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-test-suite/clang-ppc64le-test-suite/build/include -I/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-test-suite/clang-ppc64le-test-suite/llvm-project/llvm/include -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -fno-lifetime-dse -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-uninitialized -Wno-nonnull -Wno-class-memaccess -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wno-comment -Wno-misleading-indentation -fdiagnostics-color -ffunction-sections -fdata-sections -fno-common -Woverloaded-virtual -fno-strict-aliasing -O3 -DNDEBUG -std=c++17  -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -MD -MT tools/clang/lib/StaticAnalyzer/Checkers/CMakeFiles/obj.clangStaticAnalyzerCheckers.dir/StackAddrEscapeChecker.cpp.o -MF tools/clang/lib/StaticAnalyzer/Checkers/CMakeFiles/obj.clangStaticAnalyzerCheckers.dir/StackAddrEscapeChecker.cpp.o.d -o tools/clang/lib/StaticAnalyzer/Checkers/CMakeFiles/obj.clangStaticAnalyzerCheckers.dir/StackAddrEscapeChecker.cpp.o -c /home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-test-suite/clang-ppc64le-test-suite/llvm-project/clang/lib/StaticAnalyzer/Checkers/StackAddrEscapeChecker.cpp
/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-test-suite/clang-ppc64le-test-suite/llvm-project/clang/lib/StaticAnalyzer/Checkers/StackAddrEscapeChecker.cpp:252:28: error: declaration of ‘const clang::StackFrameContext* FindStackRegionsSymbolVisitor::StackFrameContext’ [-fpermissive]
   const StackFrameContext *StackFrameContext;
                            ^~~~~~~~~~~~~~~~~
In file included from /home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-test-suite/clang-ppc64le-test-suite/llvm-project/clang/include/clang/Analysis/ProgramPoint.h:17,
                 from /home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-test-suite/clang-ppc64le-test-suite/llvm-project/clang/include/clang/StaticAnalyzer/Core/Checker.h:16,
                 from /home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-test-suite/clang-ppc64le-test-suite/llvm-project/clang/include/clang/StaticAnalyzer/Core/BugReporter/BugType.h:18,
                 from /home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-test-suite/clang-ppc64le-test-suite/llvm-project/clang/lib/StaticAnalyzer/Checkers/StackAddrEscapeChecker.cpp:17:
/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-test-suite/clang-ppc64le-test-suite/llvm-project/clang/include/clang/Analysis/AnalysisDeclContext.h:299:7: error: changes meaning of ‘StackFrameContext’ from ‘class clang::StackFrameContext’ [-fpermissive]
 class StackFrameContext : public LocationContext {
       ^~~~~~~~~~~~~~~~~
15.722 [57/19/69] Linking CXX executable bin/llvm-jitlink
21.114 [57/18/70] Linking CXX executable bin/llvm-extract
22.485 [57/17/71] Linking CXX executable bin/pp-trace
22.842 [57/16/72] Linking CXX executable bin/diagtool
23.119 [57/15/73] Linking CXX executable bin/clang-include-fixer
23.701 [57/14/74] Linking CXX executable bin/clang-installapi
23.777 [57/13/75] Linking CXX executable bin/clang-reorder-fields
23.783 [57/12/76] Linking CXX executable bin/clang-diff
23.792 [57/11/77] Linking CXX executable bin/modularize
23.920 [57/10/78] Linking CXX executable bin/find-all-symbols
23.995 [57/9/79] Linking CXX executable bin/clang-include-cleaner
24.202 [57/8/80] Linking CXX executable bin/clang-refactor
24.309 [57/7/81] Linking CXX executable bin/clang-doc
24.403 [57/6/82] Linking CXX executable bin/clang-query
24.421 [57/5/83] Linking CXX executable bin/clang-move
24.459 [57/4/84] Linking CXX executable bin/tool-template
24.543 [57/3/85] Linking CXX executable bin/clang-change-namespace
25.281 [57/2/86] Building CXX object lib/CodeGen/AsmPrinter/CMakeFiles/LLVMAsmPrinter.dir/AsmPrinter.cpp.o
25.687 [57/1/87] Building CXX object lib/LTO/CMakeFiles/LLVMLTO.dir/LTO.cpp.o
In file included from /usr/include/c++/8/cassert:44,
                 from /home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-test-suite/clang-ppc64le-test-suite/llvm-project/llvm/include/llvm/ProfileData/InstrProf.h:39,
                 from /home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-test-suite/clang-ppc64le-test-suite/llvm-project/llvm/include/llvm/Analysis/IndirectCallPromotionAnalysis.h:16,
                 from /home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-test-suite/clang-ppc64le-test-suite/llvm-project/llvm/include/llvm/Transforms/IPO/MemProfContextDisambiguation.h:18,
                 from /home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-test-suite/clang-ppc64le-test-suite/llvm-project/llvm/lib/LTO/LTO.cpp:56:
/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-test-suite/clang-ppc64le-test-suite/llvm-project/llvm/include/llvm/ProfileData/InstrProf.h: In member function ‘llvm::ArrayRef<llvm::InstrProfValueSiteRecord> llvm::InstrProfRecord::getValueSitesForKind(uint32_t) const’:
/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-test-suite/clang-ppc64le-test-suite/llvm-project/llvm/include/llvm/ProfileData/InstrProf.h:968:23: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
     assert(IPVK_First <= ValueKind && ValueKind <= IPVK_Last &&

```

</details>

https://github.com/llvm/llvm-project/pull/125638


More information about the cfe-commits mailing list