[clang] [analyzer] use `invalidateRegions()` in `VisitGCCAsmStmt` (PR #109838)

Pavel Skripkin via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 24 12:09:14 PDT 2024


================
@@ -40,7 +42,19 @@ void testInlineAsmMemcpyUninit(void)
 {
     int a[10], b[10] = {}, c;
     MyMemcpy(&a[1], &b[1], sizeof(b) - sizeof(b[1]));
-    c = a[0]; // expected-warning{{Assigned value is garbage or undefined}}
+    c = a[0]; // FIXME: should be warning about uninitialized value, but invalidateRegions() also
----------------
pskrgag wrote:

Don't think it would work, since then `testInlineAsmMemcpyUninitLoop` would also fail, since only the first element of the array will be invalidated.

Maybe I am missing some API to invalidate part of the region?

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


More information about the cfe-commits mailing list