This is an archive of the discontinued LLVM Phabricator instance.

[ubsan] Don't emit function signatures for virtual methods
ClosedPublic

Authored by vsk on Oct 13 2017, 5:41 PM.

Details

Summary

The function sanitizer only checks indirect calls through function
pointers. This excludes all non-static member functions (constructor
calls, calls through thunks, etc all use a separate code path). Don't
emit function signatures for functions that won't be checked.

Apart from cutting down on code size, this should fix a regression on
Linux caused by r313096. For context, see the mailing list discussion:

r313096 - [ubsan] Function Sanitizer: Don't require writable text segments

Testing: check-clang, check-ubsan

Supersedes D38903.

Diff Detail

Repository
rL LLVM

Event Timeline

vsk created this revision.Oct 13 2017, 5:41 PM
pcc accepted this revision.Oct 13 2017, 6:11 PM

LGTM

Small nit on the first line of the commit message: it should probably mention non-static member functions, rather than virtual methods.

This revision is now accepted and ready to land.Oct 13 2017, 6:11 PM
This revision was automatically updated to reflect the committed changes.