This is an archive of the discontinued LLVM Phabricator instance.

Fix false positive related to handling of [[noreturn]] function pointers
ClosedPublic

Authored by arseniy-sonar on Oct 11 2022, 8:44 AM.

Details

Summary

Before this change, the NoReturnFunctionChecker was missing function pointers with a [[noreturn]] attribute, while CFG was constructed taking that into account, which lead CSA to take impossible paths. The reason was that the NoReturnFunctionChecker was looking for the attribute in the type of the entire call expression rather than the type of the function being called.

This change makes the [[noreturn]] attribute of a function pointer visible to NoReturnFunctionChecker. This leads to a more coherent behavior of the CSA on the AST involving

Diff Detail

Event Timeline

arseniy-sonar created this revision.Oct 11 2022, 8:44 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 11 2022, 8:44 AM
Herald added a subscriber: rnkovacs. · View Herald Transcript
arseniy-sonar requested review of this revision.Oct 11 2022, 8:44 AM
steakhal resigned from this revision.Oct 11 2022, 8:56 AM

I already reviewed this downstream.
I'll let someone else approve this.

xazax.hun accepted this revision.Oct 11 2022, 9:16 AM
This revision is now accepted and ready to land.Oct 11 2022, 9:16 AM
This revision was landed with ongoing or failed builds.Oct 12 2022, 5:47 AM
This revision was automatically updated to reflect the committed changes.