This is an archive of the discontinued LLVM Phabricator instance.

hwasan: Use C++ driver for cfi.cc test.
ClosedPublic

Authored by pcc on Jul 17 2019, 3:25 PM.

Details

Summary

It turns out that this test was only passing by accident. It was relying on
the optimizer to remove the only reference to A's vtable by realizing that
the CFI check will always fail. The vtable contains a reference to RTTI in
libc++, which will be unresolved because the C driver won't link against it.

This was found by my prototype implementation of HWASAN for globals, which
happens to end up preserving the reference.

Event Timeline

pcc created this revision.Jul 17 2019, 3:25 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptJul 17 2019, 3:25 PM
Herald added subscribers: Restricted Project, kubamracek. · View Herald Transcript
eugenis accepted this revision.Jul 17 2019, 4:29 PM

LGTM

This revision is now accepted and ready to land.Jul 17 2019, 4:29 PM
This revision was automatically updated to reflect the committed changes.