[PATCH] D126779: [analyzer] Fix assertion in simplifySymbolCast

Balázs Benics via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 8 06:42:43 PDT 2022


steakhal added a comment.

Oh I forgot to submit my review. My bad. Please investigate why we have two double casts there.



================
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())
----------------
Well, I would expect the same, but crosscheck this with the actual dump.


================
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;
----------------
Place here a FIXME that we should not have two double casts.


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