From 36e4d1d398a1526c6bc5eba12b32279dc07749d8 Mon Sep 17 00:00:00 2001 From: Vladimir Marko Date: Mon, 1 Feb 2021 10:16:05 +0000 Subject: Remove HWASan tag from method entrypoint in tests. Test: run-gtests.sh Bug: 177816575 Change-Id: If76f186d69ac9311a81e025960c13d9b99be6e56 --- compiler/common_compiler_test.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'compiler/common_compiler_test.cc') diff --git a/compiler/common_compiler_test.cc b/compiler/common_compiler_test.cc index 535749b530..426135c971 100644 --- a/compiler/common_compiler_test.cc +++ b/compiler/common_compiler_test.cc @@ -90,7 +90,9 @@ void CommonCompilerTestImpl::MakeExecutable(ArtMethod* method, const void* code_ptr = reinterpret_cast(unaligned_code_ptr) + padding; CHECK_EQ(code_ptr, static_cast(chunk->data() + (chunk->size() - code_size))); MakeExecutable(code_ptr, code.size()); - const void* method_code = CompiledMethod::CodePointer(code_ptr, + // Remove hwasan tag. This is done in kernel in newer versions. This supports older kernels. + // This is needed to support stack walking, including exception handling. + const void* method_code = CompiledMethod::CodePointer(HWASanUntag(code_ptr), compiled_method->GetInstructionSet()); LOG(INFO) << "MakeExecutable " << method->PrettyMethod() << " code=" << method_code; method->SetEntryPointFromQuickCompiledCode(method_code); -- cgit v1.2.3-59-g8ed1b