This is an archive of the discontinued LLVM Phabricator instance.

[AddressSanitizer] Copy type metadata to prevent miscompilation
ClosedPublic

Authored by ddcc on Sep 26 2020, 3:55 PM.

Details

Summary

When ASan and e.g. Dead Virtual Function Elimination are enabled, the
latter will rely on type metadata to determine if certain virtual calls can be
removed. However, ASan currently does not copy type metadata, which can cause
virtual function calls to be incorrectly removed.

Diff Detail

Event Timeline

ddcc created this revision.Sep 26 2020, 3:55 PM
Herald added a project: Restricted Project. · View Herald TranscriptSep 26 2020, 3:55 PM
Herald added a subscriber: hiraditya. · View Herald Transcript
ddcc requested review of this revision.Sep 26 2020, 3:55 PM
ddcc updated this revision to Diff 294523.Sep 26 2020, 4:02 PM

Fix optional regex

aprantl accepted this revision.Sep 28 2020, 9:12 AM
aprantl added inline comments.
llvm/test/Instrumentation/AddressSanitizer/debug_info.ll
11

Can you try to not hardcode !6 and instead use a placeholder like [[TYPE:[0-9]+]] and add a second CHECK for [[TYPE]] = ...?

This revision is now accepted and ready to land.Sep 28 2020, 9:12 AM
ddcc marked an inline comment as done.Sep 28 2020, 10:54 AM
ddcc added inline comments.
llvm/test/Instrumentation/AddressSanitizer/debug_info.ll
11

Ok, will do.

This revision was landed with ongoing or failed builds.Sep 28 2020, 10:57 AM
This revision was automatically updated to reflect the committed changes.
ddcc marked an inline comment as done.