[PATCH] D38797: [analyzer] CStringChecker: pr34460: Admit that some casts are hard to model.

Artem Dergachev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 11 06:29:05 PDT 2017


NoQ added inline comments.


================
Comment at: test/Analysis/casts.c:134-139
+  clang_analyzer_eval(y1 == y2); // expected-warning{{TRUE}}
+
+  // FIXME: should be FALSE (i.e. equal pointers).
+  clang_analyzer_eval(y1 - y2); // expected-warning{{UNKNOWN}}
+  // FIXME: should be TRUE (i.e. same symbol).
+  clang_analyzer_eval(*y1 == *y2); // expected-warning{{UNKNOWN}}
----------------
Here we have `y1` pointing to `element{element{x, 3}, 5}` vs. both `y2` and `y3` pointing to `element{x, 35}`. While `y3` is inevitably looking like that, `y2` could have been same as `y1` if we didn't unwrap multi-dimensional array elements.


https://reviews.llvm.org/D38797





More information about the cfe-commits mailing list