This is an archive of the discontinued LLVM Phabricator instance.

[analyzer] Fixed crash in StmtDataCollector when analyzing methods of template classes.
ClosedPublic

Authored by teemperor on Aug 22 2016, 11:10 AM.

Details

Summary

The current check with isTemplateInstantiation() is also returning true when calling a member method of a template class. In this case getTemplateSpecializationArgs() returns a null pointer and we crash. It seems the intended way to check for template specialization args is to make a nullptr check on getTemplateSpecializationArgs() which we start doing with this patch. We don't need to add any code for the member methods of template classes as the qualified type of the calling object already contains the template arguments of the class.

Diff Detail

Repository
rL LLVM

Event Timeline

teemperor updated this revision to Diff 68883.Aug 22 2016, 11:10 AM
teemperor retitled this revision from to [analyzer] Fixed crash in StmtDataCollector when analyzing methods of template classes..
teemperor updated this object.
teemperor added reviewers: v.g.vassilev, NoQ.
teemperor added a subscriber: cfe-commits.
NoQ accepted this revision.Aug 23 2016, 9:18 AM
NoQ edited edge metadata.

Yeah, it seems that these need to be checked.

This revision is now accepted and ready to land.Aug 23 2016, 9:18 AM
This revision was automatically updated to reflect the committed changes.