[TSan][Darwin] Fix shadow mapping for iOS simulator on Apple Silicon

With the introduction of Apple Silicon `defined(__aarch64__)` is not a
reliable way to check for the platform anymore.

We want to use the "normal" `Mapping48AddressSpace` mapping everywhere
except devices, including the iOS simulators on AS.

Relevant revisions:
https://reviews.llvm.org/D35147
https://reviews.llvm.org/D86377
https://reviews.llvm.org/D107743
https://reviews.llvm.org/D107888

Differential Revision: https://reviews.llvm.org/D115843
This commit is contained in:
Julian Lettner 2021-12-15 19:33:51 -08:00
parent 4399f3b6b0
commit 64f4041725
2 changed files with 5 additions and 5 deletions

View File

@ -585,11 +585,11 @@ ALWAYS_INLINE auto SelectMapping(Arg arg) {
return Func::template Apply<MappingGo48>(arg);
# endif
#else // SANITIZER_GO
# if defined(__x86_64__) || SANITIZER_IOSSIM || SANITIZER_MAC && !SANITIZER_IOS
return Func::template Apply<Mapping48AddressSpace>(arg);
# elif defined(__aarch64__) && defined(__APPLE__)
# if SANITIZER_IOS && !SANITIZER_IOSSIM
return Func::template Apply<MappingAppleAarch64>(arg);
# elif defined(__aarch64__) && !defined(__APPLE__)
# elif defined(__x86_64__) || SANITIZER_MAC
return Func::template Apply<Mapping48AddressSpace>(arg);
# elif defined(__aarch64__)
switch (vmaSize) {
case 39:
return Func::template Apply<MappingAarch64_39>(arg);

View File

@ -110,7 +110,7 @@ void CheckAndProtect() {
Die();
}
# if defined(__aarch64__) && defined(__APPLE__) && SANITIZER_IOS
# if SANITIZER_IOS && !SANITIZER_IOSSIM
ProtectRange(HeapMemEnd(), ShadowBeg());
ProtectRange(ShadowEnd(), MetaShadowBeg());
ProtectRange(MetaShadowEnd(), HiAppMemBeg());