IRGen: Disable ASan for the auto dynamic replacement array

This commit is contained in:
Yuta Saito
2025-05-07 10:17:27 +08:00
parent fef7f535df
commit b9128d48b5
2 changed files with 2 additions and 1 deletions

View File

@@ -1991,6 +1991,7 @@ void IRGenerator::emitDynamicReplacements() {
"\x01l_auto_dynamic_replacements", IGM.getPointerAlignment(),
/*isConstant*/ true, llvm::GlobalValue::PrivateLinkage);
autoReplVar->setSection(getDynamicReplacementSection(IGM));
disableAddressSanitizer(IGM, autoReplVar);
IGM.addUsedGlobal(autoReplVar);
if (origFuncTypes.empty())

View File

@@ -24,7 +24,7 @@
// CHECK: @"\01l_auto_dynamic_replacements" = private constant { i32, i32, [2 x i32] }
// CHECK-SAME: { i32 0, i32 1,
// CHECK-SAME: [2 x i32] [{{.*}}@"\01l_unnamed_dynamic_replacements"{{.*}}, i32 0]
// CHECK-SAME: }, section "__TEXT, __swift5_replace, regular, no_dead_strip"
// CHECK-SAME: }, section "__TEXT, __swift5_replace, regular, no_dead_strip", no_sanitize_address
// CHECK-LABEL: define swiftcc void @test_dynamically_replaceable()
// CHECK-NEXT: entry: