diff --git a/compiler-rt/lib/asan/tests/asan_test.cpp b/compiler-rt/lib/asan/tests/asan_test.cpp --- a/compiler-rt/lib/asan/tests/asan_test.cpp +++ b/compiler-rt/lib/asan/tests/asan_test.cpp @@ -203,8 +203,8 @@ TEST(AddressSanitizer, UAF_long_double) { if (sizeof(long double) == sizeof(double)) return; long double *p = Ident(new long double[10]); - EXPECT_DEATH(Ident(p)[12] = 0, "WRITE of size 1[026]"); - EXPECT_DEATH(Ident(p)[0] = Ident(p)[12], "READ of size 1[026]"); + EXPECT_DEATH(Ident(p)[12] = 0, "WRITE of size 1"); + EXPECT_DEATH(Ident(p)[0] = Ident(p)[12], "READ of size 1"); delete [] Ident(p); } diff --git a/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp b/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp --- a/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp +++ b/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp @@ -1869,20 +1869,11 @@ IRBuilder<> IRB(InsertBefore); Value *Size = ConstantInt::get(IntptrTy, TypeSize / 8); Value *AddrLong = IRB.CreatePointerCast(Addr, IntptrTy); - if (UseCalls) { - if (Exp == 0) - IRB.CreateCall(AsanMemoryAccessCallbackSized[IsWrite][0], - {AddrLong, Size}); - else - IRB.CreateCall(AsanMemoryAccessCallbackSized[IsWrite][1], - {AddrLong, Size, ConstantInt::get(IRB.getInt32Ty(), Exp)}); - } else { - Value *LastByte = IRB.CreateIntToPtr( - IRB.CreateAdd(AddrLong, ConstantInt::get(IntptrTy, TypeSize / 8 - 1)), - Addr->getType()); - instrumentAddress(I, InsertBefore, Addr, 8, IsWrite, Size, false, Exp); - instrumentAddress(I, InsertBefore, LastByte, 8, IsWrite, Size, false, Exp); - } + Value *LastByte = IRB.CreateIntToPtr( + IRB.CreateAdd(AddrLong, ConstantInt::get(IntptrTy, TypeSize / 8 - 1)), + Addr->getType()); + instrumentAddress(I, InsertBefore, Addr, 8, IsWrite, Size, UseCalls, Exp); + instrumentAddress(I, InsertBefore, LastByte, 8, IsWrite, Size, UseCalls, Exp); } void ModuleAddressSanitizer::poisonOneInitializer(Function &GlobalInit, diff --git a/llvm/test/Instrumentation/AddressSanitizer/experiment-call.ll b/llvm/test/Instrumentation/AddressSanitizer/experiment-call.ll --- a/llvm/test/Instrumentation/AddressSanitizer/experiment-call.ll +++ b/llvm/test/Instrumentation/AddressSanitizer/experiment-call.ll @@ -54,7 +54,7 @@ %t = load i48, i48* %p, align 1 ret void ; CHECK-LABEL: define void @loadN -; CHECK: __asan_exp_loadN{{.*}} i32 42 +; CHECK: __asan_exp_load1{{.*}} i32 42 ; CHECK: ret void } @@ -108,6 +108,6 @@ store i48 1, i48* %p, align 1 ret void ; CHECK-LABEL: define void @storeN -; CHECK: __asan_exp_storeN{{.*}} i32 42 +; CHECK: __asan_exp_store1{{.*}} i32 42 ; CHECK: ret void } diff --git a/llvm/test/Instrumentation/AddressSanitizer/instrumentation-with-call-threshold.ll b/llvm/test/Instrumentation/AddressSanitizer/instrumentation-with-call-threshold.ll --- a/llvm/test/Instrumentation/AddressSanitizer/instrumentation-with-call-threshold.ll +++ b/llvm/test/Instrumentation/AddressSanitizer/instrumentation-with-call-threshold.ll @@ -14,11 +14,13 @@ entry: ; CHECK-CALL: call void @__asan_load4 ; CHECK-CALL: call void @__asan_load8 -; CHECK-CALL: call void @__asan_loadN{{.*}}i64 64) -; CHECK-CALL: call void @__asan_loadN{{.*}}i64 10) +; CHECK-CALL: call void @__asan_load1 +; CHECK-CALL: call void @__asan_load1 +; CHECK-CALL: call void @__asan_load1 +; CHECK-CALL: call void @__asan_load1 ; CHECK-CUSTOM-PREFIX: call void @__foo_load4 ; CHECK-CUSTOM-PREFIX: call void @__foo_load8 -; CHECK-CUSTOM-PREFIX: call void @__foo_loadN +; CHECK-CUSTOM-PREFIX: call void @__foo_load1 ; CHECK-INLINE-NOT: call void @__asan_load %tmp1 = load i32, i32* %a, align 4 %tmp2 = load i64, i64* %b, align 8 diff --git a/llvm/test/Instrumentation/HWAddressSanitizer/kernel-inline.ll b/llvm/test/Instrumentation/HWAddressSanitizer/kernel-inline.ll --- a/llvm/test/Instrumentation/HWAddressSanitizer/kernel-inline.ll +++ b/llvm/test/Instrumentation/HWAddressSanitizer/kernel-inline.ll @@ -19,10 +19,10 @@ ; CHECK-INLINE: call void @__asan_report_load_n_noabort ; CHECK-INLINE-NOT: call void @__asan_load4_noabort ; CHECK-INLINE-NOT: call void @__asan_load8_noabort -; CHECK-INLINE-NOT: call void @__asan_loadN_noabort +; CHECK-INLINE-NOT: call void @__asan_load1_noabort ; CHECK-CALLBACK: call void @__asan_load4_noabort ; CHECK-CALLBACK: call void @__asan_load8_noabort -; CHECK-CALLBACK: call void @__asan_loadN_noabort +; CHECK-CALLBACK: call void @__asan_load1_noabort ; CHECK-CALLBACK-NOT: call void @__asan_report_load4_noabort ; CHECK-CALLBACK-NOT: call void @__asan_report_load8_noabort ; CHECK-CALLBACK-NOT: call void @__asan_report_load_n_noabort