summaryrefslogtreecommitdiff
path: root/compiler/common_compiler_test.cc
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/common_compiler_test.cc')
-rw-r--r--compiler/common_compiler_test.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/compiler/common_compiler_test.cc b/compiler/common_compiler_test.cc
index 6b4dbed03b..4b6a557455 100644
--- a/compiler/common_compiler_test.cc
+++ b/compiler/common_compiler_test.cc
@@ -107,7 +107,9 @@ void CommonCompilerTest::MakeExecutable(const void* code_start, size_t code_leng
uintptr_t base = RoundDown(data, kPageSize);
uintptr_t limit = RoundUp(data + code_length, kPageSize);
uintptr_t len = limit - base;
- int result = mprotect(reinterpret_cast<void*>(base), len, PROT_READ | PROT_WRITE | PROT_EXEC);
+ // Remove hwasan tag. This is done in kernel in newer versions. This supports older kernels.
+ void* base_ptr = HWASanUntag(reinterpret_cast<void*>(base));
+ int result = mprotect(base_ptr, len, PROT_READ | PROT_WRITE | PROT_EXEC);
CHECK_EQ(result, 0);
CHECK(FlushCpuCaches(reinterpret_cast<void*>(base), reinterpret_cast<void*>(base + len)));