[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:15 PST 2025


llvm-ci wrote:

LLVM Buildbot has detected a new failure on builder `clang-m68k-linux-cross` running on `suse-gary-m68k-cross` while building `clang` at step 4 "build stage 1".

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

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

```
Step 4 (build stage 1) failure: 'ninja' (failure)
...
[60/135] Linking CXX executable bin/llvm-jitlink
[61/135] Linking CXX executable bin/llvm-extract
[62/135] Linking CXX executable bin/find-all-symbols
[63/135] Linking CXX executable bin/clang-diff
[64/135] Linking CXX executable bin/clang-refactor
[65/135] Linking CXX executable bin/tool-template
[66/135] Linking CXX executable bin/pp-trace
[67/135] Linking CXX executable bin/modularize
[68/135] Linking CXX executable bin/clang-installapi
[69/135] 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 
/usr/bin/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/var/lib/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/stage1/tools/clang/lib/StaticAnalyzer/Checkers -I/var/lib/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/llvm/clang/lib/StaticAnalyzer/Checkers -I/var/lib/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/llvm/clang/include -I/var/lib/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/stage1/tools/clang/include -I/var/lib/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/stage1/include -I/var/lib/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/llvm/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-maybe-uninitialized -Wno-nonnull -Wno-class-memaccess -Wno-redundant-move -Wno-pessimizing-move -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -Wno-misleading-indentation -Wctad-maybe-unsupported -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 /var/lib/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/llvm/clang/lib/StaticAnalyzer/Checkers/StackAddrEscapeChecker.cpp
/var/lib/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/llvm/clang/lib/StaticAnalyzer/Checkers/StackAddrEscapeChecker.cpp:252:28: error: declaration of ‘const clang::StackFrameContext* FindStackRegionsSymbolVisitor::StackFrameContext’ changes meaning of ‘StackFrameContext’ [-Wchanges-meaning]
  252 |   const StackFrameContext *StackFrameContext;
      |                            ^~~~~~~~~~~~~~~~~
/var/lib/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/llvm/clang/lib/StaticAnalyzer/Checkers/StackAddrEscapeChecker.cpp:252:9: note: used here to mean ‘class clang::StackFrameContext’
  252 |   const StackFrameContext *StackFrameContext;
      |         ^~~~~~~~~~~~~~~~~
In file included from /var/lib/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/llvm/clang/include/clang/Analysis/ProgramPoint.h:17,
                 from /var/lib/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/llvm/clang/include/clang/StaticAnalyzer/Core/Checker.h:16,
                 from /var/lib/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/llvm/clang/include/clang/StaticAnalyzer/Core/BugReporter/BugType.h:18,
                 from /var/lib/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/llvm/clang/lib/StaticAnalyzer/Checkers/StackAddrEscapeChecker.cpp:17:
/var/lib/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/llvm/clang/include/clang/Analysis/AnalysisDeclContext.h:299:7: note: declared here
  299 | class StackFrameContext : public LocationContext {
      |       ^~~~~~~~~~~~~~~~~
[70/135] Linking CXX executable bin/clang-include-cleaner
[71/135] Linking CXX executable bin/clang-change-namespace
[72/135] Linking CXX executable bin/clang-include-fixer
[73/135] Linking CXX executable bin/clang-query
[74/135] Linking CXX executable bin/clang-doc
[75/135] Linking CXX executable bin/clang-reorder-fields
[76/135] Linking CXX executable bin/clang-move
[77/135] Building CXX object lib/CodeGen/AsmPrinter/CMakeFiles/LLVMAsmPrinter.dir/AsmPrinter.cpp.o
[78/135] Building CXX object lib/LTO/CMakeFiles/LLVMLTO.dir/LTO.cpp.o
ninja: build stopped: subcommand failed.

```

</details>

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


More information about the cfe-commits mailing list