[PATCH] D124349: [analyzer] Get direct binding for specific punned case

Domján Dániel via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri May 19 08:56:37 PDT 2023


isuckatcs added inline comments.


================
Comment at: clang/test/Analysis/array-punned-region.c:23
+  BITFIELD_CAST *pff = &ff;
+  int a = *((int *)pff + 2); // expected-warning{{Assigned value is garbage or undefined [core.uninitialized.Assign]}}
+  return a;
----------------
@steakhal @martong @NoQ 

Isn't this actually a false positive here?

`(int *)pff + 2` points to `ff.b[1]`, which is initialized to `0`. 

https://godbolt.org/z/Gh8a4aMe8







Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D124349/new/

https://reviews.llvm.org/D124349



More information about the cfe-commits mailing list