This is an archive of the discontinued LLVM Phabricator instance.

[analyzer] Fix an assertion fail in VirtualCallChecker
ClosedPublic

Authored by xazax.hun on Sep 18 2017, 8:09 AM.

Details

Summary

This patch attempts to fix PR34451.

The getBestDynamicClassType call can only handle RecordDecls and pointers to RecordDecls. The code removed all the implicit casts, this includes the array to pointer decay. After removing the decay, the checker passed an array type to getBestDynamicClassType which triggered the assertion.

Diff Detail

Repository
rL LLVM

Event Timeline

xazax.hun created this revision.Sep 18 2017, 8:09 AM
alexfh accepted this revision.Sep 18 2017, 8:58 AM

Looks reasonable, but please wait for someone who actually knows this code.

This revision is now accepted and ready to land.Sep 18 2017, 8:58 AM

Actually, after looking at the getBestDynamicClassType() implementation, I'm pretty sure it does all things IgnoreImpCasts() used to do that are relevant to the use case. So the patch seems to be trivially correct. Other reviewers' comments (if any) can be addressed post-commit. Thanks again for the fix!

This revision was automatically updated to reflect the committed changes.