[PATCH] D126779: [analyzer] Fix assertion in simplifySymbolCast
Gabor Marton via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Jun 17 09:29:10 PDT 2022
martong marked 2 inline comments as done.
martong added inline comments.
================
Comment at: clang/lib/StaticAnalyzer/Core/SValBuilder.cpp:1082
+ // FIXME support cast from non-integers.
+ // E.g (char)(double)(double x) -> (char)(double x)
+ if (!RT->isIntegralOrEnumerationType())
----------------
steakhal wrote:
> Well, I would expect the same, but crosscheck this with the actual dump.
Please elaborate.
================
Comment at: clang/test/Analysis/produce-symbolcast_x86.cpp:16
+ double D = n / 30;
+ clang_analyzer_dump(D); // expected-warning{{(double) ((double) ((reg_$0<int n>) / 30))}}
+ char C = D;
----------------
steakhal wrote:
> Place here a FIXME that we should not have two double casts.
The `(double)(double)` problem is handled in the parent patch. Please check that out.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D126779/new/
https://reviews.llvm.org/D126779
More information about the cfe-commits
mailing list