Crashlog: Windows: Fix sign error for symbol offsets in crashlog

This commit is contained in:
Jonathan G Rennison
2022-12-22 12:49:37 +00:00
parent d90c381d12
commit c6e5776cc4

View File

@@ -574,7 +574,7 @@ char *CrashLogWindows::AppendDecodedStacktrace(char *buffer, const char *last) c
free(demangled); free(demangled);
#endif #endif
if (symbol_ok && bfd_info.function_addr) { if (symbol_ok && bfd_info.function_addr) {
if (bfd_info.function_addr < frame.AddrPC.Offset) { if (bfd_info.function_addr > frame.AddrPC.Offset) {
buffer += seprintf(buffer, last, " - " OTTD_PRINTF64U, static_cast<DWORD64>(bfd_info.function_addr) - frame.AddrPC.Offset); buffer += seprintf(buffer, last, " - " OTTD_PRINTF64U, static_cast<DWORD64>(bfd_info.function_addr) - frame.AddrPC.Offset);
} else { } else {
buffer += seprintf(buffer, last, " + " OTTD_PRINTF64U, frame.AddrPC.Offset - static_cast<DWORD64>(bfd_info.function_addr)); buffer += seprintf(buffer, last, " + " OTTD_PRINTF64U, frame.AddrPC.Offset - static_cast<DWORD64>(bfd_info.function_addr));