[clang] [analyzer] MoveChecker: correct invalidation of this-regions (PR #169626)

via cfe-commits cfe-commits at lists.llvm.org
Fri Nov 28 08:05:10 PST 2025


================
@@ -709,18 +710,16 @@ ProgramStateRef MoveChecker::checkRegionChanges(
     // that are passed directly via non-const pointers or non-const references
     // or rvalue references.
     // In case of an InstanceCall don't invalidate the this-region since
-    // it is fully handled in checkPreCall and checkPostCall.
-    const MemRegion *ThisRegion = nullptr;
-    if (const auto *IC = dyn_cast<CXXInstanceCall>(Call))
-      ThisRegion = IC->getCXXThisVal().getAsRegion();
+    // it is fully handled in checkPreCall and checkPostCall, but do invalidate
+    // its strict subregions, as they are not handled.
----------------
guillem-bartrina-sonarsource wrote:

Note that the added/modified lines are just a continuation of the comment :smile:

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


More information about the cfe-commits mailing list