From 831d8e1a9173b1fb7e01f10fc1d33f42fe2da0fd Mon Sep 17 00:00:00 2001 From: leper Date: Mon, 16 Mar 2020 21:08:18 +0100 Subject: [PATCH] Fix build on AArch64. Fixes #298. --- src/nvcore/Debug.cpp | 11 ++++++++++- src/nvcore/Debug.h | 2 +- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/nvcore/Debug.cpp b/src/nvcore/Debug.cpp index 38429e9..f25c5ca 100644 --- a/src/nvcore/Debug.cpp +++ b/src/nvcore/Debug.cpp @@ -1015,6 +1015,12 @@ void debug::dumpInfo() #endif } +static void getEmptyVAList(va_list& list, ...) +{ + va_start(list, list); + va_end(list); +} + /// Dump callstack using the specified handler. void debug::dumpCallstack(MessageHandler *messageHandler, int callstackLevelsToSkip /*= 0*/) { @@ -1027,8 +1033,11 @@ void debug::dumpCallstack(MessageHandler *messageHandler, int callstackLevelsToS Array lines; writeStackTrace(trace, size, callstackLevelsToSkip + 1, lines); // + 1 to skip the call to dumpCallstack + va_list empty; + getEmptyVAList(empty); + for (uint i = 0; i < lines.count(); i++) { - messageHandler->log(lines[i], NULL); + messageHandler->log(lines[i], empty); delete lines[i]; } } diff --git a/src/nvcore/Debug.h b/src/nvcore/Debug.h index c3a4144..4aca31b 100644 --- a/src/nvcore/Debug.h +++ b/src/nvcore/Debug.h @@ -166,7 +166,7 @@ NVCORE_API void NV_CDECL nvDebugPrint( const char *msg, ... ) __attribute__((for namespace nv { inline bool isValidPtr(const void * ptr) { - #if NV_CPU_X86_64 || POSH_CPU_PPC64 + #if NV_CPU_X86_64 || POSH_CPU_PPC64 || NV_CPU_AARCH64 if (ptr == NULL) return true; if (reinterpret_cast(ptr) < 0x10000ULL) return false; if (reinterpret_cast(ptr) >= 0x000007FFFFFEFFFFULL) return false;