[PATCH] D93595: [analyzer] Fix extraction of punned and known scalar SVals

Artem Dergachev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Dec 22 23:05:27 PST 2020


NoQ added inline comments.


================
Comment at: clang/test/Analysis/concrete-endian.cpp:49
+#elif defined(__BIG_ENDIAN__)
+  clang_analyzer_eval(pps[3] == 0x8877);      // expected-warning{{TRUE}}
+  clang_analyzer_eval(pps[2] == 0xaa99);      // expected-warning{{TRUE}}
----------------
NoQ wrote:
> I suspect that exactly one of `pps[0]` in the little endian case or `pps[3]` in the big endian case should be `0x7788` instead. Like, they're in the opposite order, right?
Wait, loads are also in the opposite order. Nvm. Your code is correct and looks like there's indeed a nice and succint way to do that.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D93595



More information about the cfe-commits mailing list