[all-commits] [llvm/llvm-project] b41240: [analyzer][NFC] Introduce APSIntPtr, a safe wrappe...
Balazs Benics via All-commits
all-commits at lists.llvm.org
Thu Dec 19 03:04:26 PST 2024
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: b41240be6b9e58687011b2bd1b942c6625cbb5ad
https://github.com/llvm/llvm-project/commit/b41240be6b9e58687011b2bd1b942c6625cbb5ad
Author: Balazs Benics <benicsbalazs at gmail.com>
Date: 2024-12-19 (Thu, 19 Dec 2024)
Changed paths:
A clang/include/clang/StaticAnalyzer/Core/PathSensitive/APSIntPtr.h
M clang/include/clang/StaticAnalyzer/Core/PathSensitive/BasicValueFactory.h
M clang/include/clang/StaticAnalyzer/Core/PathSensitive/ProgramState.h
M clang/include/clang/StaticAnalyzer/Core/PathSensitive/SMTConstraintManager.h
M clang/lib/StaticAnalyzer/Checkers/CStringChecker.cpp
M clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp
M clang/lib/StaticAnalyzer/Checkers/VLASizeChecker.cpp
M clang/lib/StaticAnalyzer/Core/BasicValueFactory.cpp
M clang/lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp
Log Message:
-----------
[analyzer][NFC] Introduce APSIntPtr, a safe wrapper of APSInt (1/4) (#120435)
One could create dangling APSInt references in various ways in the past, that were sometimes assumed to be persisted in the BasicValueFactor.
One should always use BasicValueFactory to create persistent APSInts, that could be used by ConcreteInts or SymIntExprs and similar long-living objects.
If one used a temporary or local variables for this, these would dangle.
To enforce the contract of the analyzer BasicValueFactory and the uses of APSInts, let's have a dedicated strong-type for this.
The idea is that APSIntPtr is always owned by the BasicValueFactory, and that is the only component that can construct it.
These PRs are all NFC - besides fixing dangling APSInt references.
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list