This is an archive of the discontinued LLVM Phabricator instance.

[Darwin][ASan][Sanitizer] Fixes Sanitizer NonUnique Identifier to Account for Mac arm64 architectures.
ClosedPublic

Authored by thetruestblue on Apr 13 2022, 2:31 PM.

Details

Summary

Current check assumes iOS as the only Apple devices running arm64.

#if SANITIZER_MAC && !(defined(__arm64__) && SANITIZER_IOS)

Stops Apple Silicon from being flagged as requiring unique RTTI.
This introduced unexpected behavior within the sanitizer.

This patch fixes existing test on arm64 Mac:
compiler-rt/test/ubsan/TestCases/TypeCheck/vptr-non-unique-typeinfo.cpp

rdar://91446703

Diff Detail

Event Timeline

thetruestblue created this revision.Apr 13 2022, 2:31 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 13 2022, 2:31 PM
thetruestblue requested review of this revision.Apr 13 2022, 2:31 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 13 2022, 2:31 PM
Herald added a subscriber: Restricted Project. · View Herald Transcript
thetruestblue edited the summary of this revision. (Show Details)Apr 13 2022, 2:32 PM
thetruestblue edited the summary of this revision. (Show Details)Apr 13 2022, 2:56 PM
yln accepted this revision.Apr 13 2022, 3:24 PM

LGTM, thanks!

This revision is now accepted and ready to land.Apr 13 2022, 3:24 PM

It may be more canonical to use:

#if SANITIZER_MAC && SANITIZER_X64

Reasoning: While _M_X64 is included in SANITIZER_X64 (along with x86_64), it's Windows-only and is clearly intended as an alias or alternate for x86_64 w.r.t. sanitizer.