Skip to content

Commit 401b705

Browse files
Merge pull request #81348 from kateinoigakukun/yt/dyn-replace-asan
IRGen: Disable ASan for the auto dynamic replacement array
2 parents f8218e3 + b9128d4 commit 401b705

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

lib/IRGen/GenDecl.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2045,6 +2045,7 @@ void IRGenerator::emitDynamicReplacements() {
20452045
"\x01l_auto_dynamic_replacements", IGM.getPointerAlignment(),
20462046
/*isConstant*/ true, llvm::GlobalValue::PrivateLinkage);
20472047
autoReplVar->setSection(getDynamicReplacementSection(IGM));
2048+
disableAddressSanitizer(IGM, autoReplVar);
20482049
IGM.addUsedGlobal(autoReplVar);
20492050

20502051
if (origFuncTypes.empty())

test/IRGen/dynamic_replaceable.sil

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
// CHECK: @"\01l_auto_dynamic_replacements" = private constant { i32, i32, [2 x i32] }
2525
// CHECK-SAME: { i32 0, i32 1,
2626
// CHECK-SAME: [2 x i32] [{{.*}}@"\01l_unnamed_dynamic_replacements"{{.*}}, i32 0]
27-
// CHECK-SAME: }, section "__TEXT, __swift5_replace, regular, no_dead_strip"
27+
// CHECK-SAME: }, section "__TEXT, __swift5_replace, regular, no_dead_strip", no_sanitize_address
2828

2929
// CHECK-LABEL: define swiftcc void @test_dynamically_replaceable()
3030
// CHECK-NEXT: entry:

0 commit comments

Comments
 (0)