1//===-- hwasan_poisoning.cpp ------------------------------------*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9// This file is a part of HWAddressSanitizer.
10//
11//===----------------------------------------------------------------------===//
12
13#include "hwasan_poisoning.h"
14
15#include "hwasan_mapping.h"
16#include "interception/interception.h"
17#include "sanitizer_common/sanitizer_common.h"
18#include "sanitizer_common/sanitizer_linux.h"
19
20namespace __hwasan {
21
22uptr TagMemory(uptr p, uptr size, tag_t tag) {
23 uptr start = RoundDownTo(x: p, boundary: kShadowAlignment);
24 uptr end = RoundUpTo(size: p + size, boundary: kShadowAlignment);
25 return TagMemoryAligned(p: start, size: end - start, tag);
26}
27
28} // namespace __hwasan
29
30// --- Implementation of LSan-specific functions --- {{{1
31namespace __lsan {
32bool WordIsPoisoned(uptr addr) {
33 // Fixme: implement actual tag checking.
34 return false;
35}
36} // namespace __lsan
37

source code of compiler-rt/lib/hwasan/hwasan_poisoning.cpp