diff --git a/src/nvcore/Debug.h b/src/nvcore/Debug.h index 4aca31b8..fc606319 100644 --- a/src/nvcore/Debug.h +++ b/src/nvcore/Debug.h @@ -167,8 +167,12 @@ namespace nv { inline bool isValidPtr(const void * ptr) { #if NV_CPU_X86_64 || POSH_CPU_PPC64 || NV_CPU_AARCH64 - if (ptr == NULL) return true; - if (reinterpret_cast(ptr) < 0x10000ULL) return false; + if (ptr == nullptr) return true; + // MACH_VM_MIN_ADDRESS == 0 + # ifndef __MACH__ + if (reinterpret_cast(ptr) < 0x10000ULL) return false; + #endif + if (reinterpret_cast(ptr) >= 0x000007FFFFFEFFFFULL) return false; #else if (reinterpret_cast(ptr) == 0xcccccccc) return false;