[clang] [analyzer] Wrap SymbolicRegions by ElementRegions before getting a FieldRegion (PR #85211)

via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 18 05:13:24 PDT 2024


================
@@ -451,6 +451,38 @@ void ProgramState::setStore(const StoreRef &newStore) {
   store = newStoreStore;
 }
 
+/// FieldRegions are expected to be wrapped by an ElementRegion as a canonical
+/// representation. See f8643a9b31c4029942f67d4534c9139b45173504 why.
+static SVal wrapSymbolicRegion(const ProgramState &State, SVal Base) {
----------------
NagyDonat wrote:

Why is this a global static function and not a private method of `ProgramState`? Calling this function with `*this` as the first argument triggers my "Why is this trickery useful?" intuition; and if it could work as a method, then I would prefer that "more natural" solution.

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


More information about the cfe-commits mailing list