This is an archive of the discontinued LLVM Phabricator instance.

[analyzer] Fix assertion in simplifySymbolCast
ClosedPublic

Authored by martong on Jun 1 2022, 7:32 AM.

Details

Summary

Added a new test code that fails an assertion in the baseline.
That is because getAPSIntType works only with integral types.

Diff Detail

Event Timeline

martong created this revision.Jun 1 2022, 7:32 AM
Herald added a project: Restricted Project. · View Herald Transcript
martong requested review of this revision.Jun 1 2022, 7:32 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 1 2022, 7:32 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript

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

clang/lib/StaticAnalyzer/Core/SValBuilder.cpp
1082

Well, I would expect the same, but crosscheck this with the actual dump.

clang/test/Analysis/produce-symbolcast_x86.cpp
16

Place here a FIXME that we should not have two double casts.

martong updated this revision to Diff 437938.Jun 17 2022, 9:26 AM
  • Rebase on dependent patch
martong marked 2 inline comments as done.Jun 17 2022, 9:29 AM
martong added inline comments.
clang/lib/StaticAnalyzer/Core/SValBuilder.cpp
1082

Please elaborate.

clang/test/Analysis/produce-symbolcast_x86.cpp
16

The (double)(double) problem is handled in the parent patch. Please check that out.

steakhal accepted this revision.Jun 18 2022, 11:18 AM

LGTM

clang/lib/StaticAnalyzer/Core/SValBuilder.cpp
1082

nvm

clang/test/Analysis/produce-symbolcast_x86.cpp
16

Yeey, awesome!

This revision is now accepted and ready to land.Jun 18 2022, 11:18 AM
This revision was landed with ongoing or failed builds.Jul 5 2022, 10:02 AM
This revision was automatically updated to reflect the committed changes.
martong marked 2 inline comments as done.