diff options
Diffstat (limited to 'lib/sanitizer_common/sanitizer_coverage_fuchsia.cc')
-rw-r--r-- | lib/sanitizer_common/sanitizer_coverage_fuchsia.cc | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/lib/sanitizer_common/sanitizer_coverage_fuchsia.cc b/lib/sanitizer_common/sanitizer_coverage_fuchsia.cc index c5be48bceace..b4ffcca5c30b 100644 --- a/lib/sanitizer_common/sanitizer_coverage_fuchsia.cc +++ b/lib/sanitizer_common/sanitizer_coverage_fuchsia.cc @@ -1,11 +1,11 @@ -//===-- sanitizer_coverage_fuchsia.cc ------------------------------------===// +//===-- sanitizer_coverage_fuchsia.cc -------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // -//===---------------------------------------------------------------------===// +//===----------------------------------------------------------------------===// // // Sanitizer Coverage Controller for Trace PC Guard, Fuchsia-specific version. // @@ -49,7 +49,7 @@ constexpr const char kSancovSinkName[] = "sancov"; // Collects trace-pc guard coverage. // This class relies on zero-initialization. -class TracePcGuardController { +class TracePcGuardController final { public: // For each PC location being tracked, there is a u32 reserved in global // data called the "guard". At startup, we assign each guard slot a @@ -113,11 +113,11 @@ class TracePcGuardController { // We can always spare the 32G of address space. static constexpr size_t MappingSize = sizeof(uptr) << 32; - BlockingMutex setup_lock_; - uptr *array_; - u32 next_index_; - zx_handle_t vmo_; - char vmo_name_[ZX_MAX_NAME_LEN]; + BlockingMutex setup_lock_ = BlockingMutex(LINKER_INITIALIZED); + uptr *array_ = nullptr; + u32 next_index_ = 0; + zx_handle_t vmo_ = {}; + char vmo_name_[ZX_MAX_NAME_LEN] = {}; size_t DataSize() const { return next_index_ * sizeof(uintptr_t); } @@ -146,9 +146,9 @@ class TracePcGuardController { // indices, but we'll never move the mapping address so we don't have // any multi-thread synchronization issues with that. uintptr_t mapping; - status = - _zx_vmar_map(_zx_vmar_root_self(), 0, vmo_, 0, MappingSize, - ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE, &mapping); + status = _zx_vmar_map_old(_zx_vmar_root_self(), 0, vmo_, 0, MappingSize, + ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE, + &mapping); CHECK_EQ(status, ZX_OK); // Hereafter other threads are free to start storing into |