[compiler-rt] 7df55e5 - [scudo] Ensure pointer is not null
Alex Brachet via llvm-commits
llvm-commits at lists.llvm.org
Tue May 31 10:17:28 PDT 2022
Author: Alex Brachet
Date: 2022-05-31T17:16:49Z
New Revision: 7df55e5ed735511aa2f7a078ce17e7f00c7e54db
URL: https://github.com/llvm/llvm-project/commit/7df55e5ed735511aa2f7a078ce17e7f00c7e54db
DIFF: https://github.com/llvm/llvm-project/commit/7df55e5ed735511aa2f7a078ce17e7f00c7e54db.diff
LOG: [scudo] Ensure pointer is not null
Differential revision: https://reviews.llvm.org/D126499
Added:
Modified:
compiler-rt/lib/scudo/standalone/fuchsia.cpp
Removed:
################################################################################
diff --git a/compiler-rt/lib/scudo/standalone/fuchsia.cpp b/compiler-rt/lib/scudo/standalone/fuchsia.cpp
index 088f077b4d9eb..8ab2b382a36a8 100644
--- a/compiler-rt/lib/scudo/standalone/fuchsia.cpp
+++ b/compiler-rt/lib/scudo/standalone/fuchsia.cpp
@@ -89,6 +89,8 @@ void *map(void *Addr, uptr Size, const char *Name, uptr Flags,
uintptr_t P;
zx_vm_option_t MapFlags =
ZX_VM_PERM_READ | ZX_VM_PERM_WRITE | ZX_VM_ALLOW_FAULTS;
+ if (Addr)
+ DCHECK(Data);
const uint64_t Offset =
Addr ? reinterpret_cast<uintptr_t>(Addr) - Data->VmarBase : 0;
if (Offset)
More information about the llvm-commits
mailing list