This is an archive of the discontinued LLVM Phabricator instance.

[NFC][CLANG] Fix Static Code Analyzer Concerns
ClosedPublic

Authored by Manna on Jun 1 2023, 4:04 PM.

Details

Summary

This patch uses castAs instead of getAs which will assert if the type doesn't match to resolve dereference issue with nullptr FPT when calling getThisType() in clang::​CodeGen::​CGDebugInfo::​CreateType(clang::​MemberPointerType const *, llvm::​DIFile *).

Diff Detail

Event Timeline

Manna created this revision.Jun 1 2023, 4:04 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 1 2023, 4:04 PM
Manna requested review of this revision.Jun 1 2023, 4:04 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 1 2023, 4:04 PM
Manna retitled this revision from [NFC][CLANG] Fix Static Code Analyzer Concern with nullptr dereference issue to [NFC][CLANG] Fix Static Code Analyzer Concerns.Jun 1 2023, 4:13 PM
Manna edited the summary of this revision. (Show Details)
erichkeane accepted this revision.Jun 2 2023, 5:59 AM
This revision is now accepted and ready to land.Jun 2 2023, 5:59 AM
Manna added a comment.Jun 2 2023, 6:46 AM

Thank you @erichkeane for reviews!

This revision was automatically updated to reflect the committed changes.