Page MenuHomePhabricator

[analyzer] Treat pointers to static member functions as function pointers
ClosedPublic

Authored by dcoughlin on Dec 21 2016, 2:35 PM.

Details

Summary

Sema treats pointers to static member functions as having function pointer
type, so treat treat them as function pointer values in the analyzer as well.
This prevents an assertion failure in SValBuilder::evalBinOp caused by code
that expects function pointers to be Locs (in contrast, PointerToMember values
are nonlocs).

Kirill: does this look alright to you?

Diff Detail

Event Timeline

dcoughlin updated this revision to Diff 82274.Dec 21 2016, 2:35 PM
dcoughlin retitled this revision from to [analyzer] Treat pointers to static member functions as function pointers.
dcoughlin updated this object.
dcoughlin added a reviewer: kromanenkov.
dcoughlin added subscribers: cfe-commits, NoQ, zaks.anna.
kromanenkov accepted this revision.Jan 10 2017, 6:10 AM
kromanenkov edited edge metadata.

Looks good to me, apart from a very small cavil introduced in not even your code. Thanks for not leaving pointers to static member functions out of account!

test/Analysis/pointer-to-member.cpp
80–81

This line is not affected by your patch but would you please delete the extra space before the second brace?

This revision is now accepted and ready to land.Jan 10 2017, 6:10 AM
dcoughlin updated this revision to Diff 83828.Jan 10 2017, 10:46 AM
dcoughlin edited edge metadata.

Updating spacing, as @kromanenkov requested.

dcoughlin marked an inline comment as done.Jan 10 2017, 10:46 AM
This revision was automatically updated to reflect the committed changes.