File tree Expand file tree Collapse file tree 2 files changed +16
-1
lines changed
lib/Transforms/Instrumentation
test/Instrumentation/HWAddressSanitizer Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -1531,7 +1531,13 @@ void HWAddressSanitizer::instrumentPersonalityFunctions() {
1531
1531
void HWAddressSanitizer::ShadowMapping::init (Triple &TargetTriple,
1532
1532
bool InstrumentWithCalls) {
1533
1533
Scale = kDefaultShadowScale ;
1534
- if (ClMappingOffset.getNumOccurrences () > 0 ) {
1534
+ if (TargetTriple.isOSFuchsia ()) {
1535
+ // Fuchsia is always PIE, which means that the beginning of the address
1536
+ // space is always available.
1537
+ InGlobal = false ;
1538
+ InTls = false ;
1539
+ Offset = 0 ;
1540
+ } else if (ClMappingOffset.getNumOccurrences () > 0 ) {
1535
1541
InGlobal = false ;
1536
1542
InTls = false ;
1537
1543
Offset = ClMappingOffset;
Original file line number Diff line number Diff line change
1
+ ; Check HWASan shadow mapping on Fuchsia.
2
+ ; RUN: opt -hwasan -S -mtriple=aarch64-unknown-fuchsia < %s | FileCheck %s
3
+
4
+ define i32 @test_load (i32* %a ) sanitize_hwaddress {
5
+ ; CHECK: %.hwasan.shadow = call i8* asm "", "=r,0"(i8* null)
6
+ entry:
7
+ %x = load i32 , i32* %a , align 4
8
+ ret i32 %x
9
+ }
You can’t perform that action at this time.
0 commit comments