[clang] [analyzer] Fix assertion failure in `CXXInstanceCall::getCXXThisVal` (PR #70837)
via cfe-commits
cfe-commits at lists.llvm.org
Thu Nov 2 09:09:55 PDT 2023
================
@@ -30,3 +30,24 @@ void test(int i) {
clang_analyzer_dump(g4);
// expected-warning at -1 {{&i [as 64 bit integer]}}
}
+
+struct A {
+ int n;
+ void set(int x) {
+ n = x;
+ }
+};
+using ptr_size = decltype(sizeof(void *));
+void gh_69922(ptr_size p) {
+ // expected-warning-re at +1 {{(reg_${{[0-9]+}}<ptr_size p>) & 1U}}
+ clang_analyzer_dump(__builtin_bit_cast(A*, p & 1));
----------------
DonatNagyE wrote:
What is the role of the `&` operator here? Is it just an arbitrary numerical operation that's not handled by the analyzer?
(No action needed, I'm just curious.)
https://github.com/llvm/llvm-project/pull/70837
More information about the cfe-commits
mailing list