[PATCH] D55875: [analyzer] pr38668: RegionStore: Do not attempt to cast loaded values of non-scalar types.
Artem Dergachev via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Dec 20 11:42:00 PST 2018
NoQ marked an inline comment as done.
NoQ added inline comments.
================
Comment at: lib/StaticAnalyzer/Core/Store.cpp:410
+ QualType OrigTy = R->getValueType();
+
----------------
NoQ wrote:
> This is entirely incorrect. The whole point of this function is to handle the case when `R->getValueType()` has nothing to do with the original type of `V`.
>
> Unfortunately, "type of an `SVal`" is not a thing, so it's going to be a bit more verbose.
Relevant test case:
```
double no_crash_reinterpret_double_as_int(double a) {
*(int *)&a = 1;
return a * a;
}
```
Repository:
rC Clang
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D55875/new/
https://reviews.llvm.org/D55875
More information about the cfe-commits
mailing list