Fix build on AArch64. Fixes #298.

pull/309/head
leper 4 years ago
parent b45560cfc4
commit 831d8e1a91

@ -1015,6 +1015,12 @@ void debug::dumpInfo()
#endif #endif
} }
static void getEmptyVAList(va_list& list, ...)
{
va_start(list, list);
va_end(list);
}
/// Dump callstack using the specified handler. /// Dump callstack using the specified handler.
void debug::dumpCallstack(MessageHandler *messageHandler, int callstackLevelsToSkip /*= 0*/) void debug::dumpCallstack(MessageHandler *messageHandler, int callstackLevelsToSkip /*= 0*/)
{ {
@ -1027,8 +1033,11 @@ void debug::dumpCallstack(MessageHandler *messageHandler, int callstackLevelsToS
Array<const char *> lines; Array<const char *> lines;
writeStackTrace(trace, size, callstackLevelsToSkip + 1, lines); // + 1 to skip the call to dumpCallstack 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++) { for (uint i = 0; i < lines.count(); i++) {
messageHandler->log(lines[i], NULL); messageHandler->log(lines[i], empty);
delete lines[i]; delete lines[i];
} }
} }

@ -166,7 +166,7 @@ NVCORE_API void NV_CDECL nvDebugPrint( const char *msg, ... ) __attribute__((for
namespace nv namespace nv
{ {
inline bool isValidPtr(const void * ptr) { 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 (ptr == NULL) return true;
if (reinterpret_cast<uint64>(ptr) < 0x10000ULL) return false; if (reinterpret_cast<uint64>(ptr) < 0x10000ULL) return false;
if (reinterpret_cast<uint64>(ptr) >= 0x000007FFFFFEFFFFULL) return false; if (reinterpret_cast<uint64>(ptr) >= 0x000007FFFFFEFFFFULL) return false;

Loading…
Cancel
Save