From 4f27af9949de9ce561d214896a2b3e7fa9b7739d Mon Sep 17 00:00:00 2001 From: kd-11 Date: Sat, 7 Sep 2024 15:20:25 +0000 Subject: [PATCH] Fix compilation warning --- Utilities/Thread.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Utilities/Thread.cpp b/Utilities/Thread.cpp index 6c5ea25b1b..bcc18f8387 100644 --- a/Utilities/Thread.cpp +++ b/Utilities/Thread.cpp @@ -1841,17 +1841,17 @@ static LONG exception_filter(PEXCEPTION_POINTERS pExp) noexcept } #if defined(ARCH_X64) -#define RIP(ctx) ctx->Rip + const exec_addr = pExp->ContextRecord->Rip; #elif defined(ARCH_ARM64) -#define RIP(ctx) ctx->Pc + const exec_addr = pExp->ContextRecord->Pc; #else #error "Unimplemented exception handling for this architecture" #endif - fmt::append(msg, "Instruction address: %p.\n", RIP(pExp->ContextRecord)); + fmt::append(msg, "Instruction address: %p.\n", exec_addr); DWORD64 unwind_base; - if (const auto rtf = RtlLookupFunctionEntry(RIP(pExp->ContextRecord), &unwind_base, nullptr)) + if (const auto rtf = RtlLookupFunctionEntry(exec_addr, &unwind_base, nullptr)) { // Get function address const DWORD64 func_addr = rtf->BeginAddress + unwind_base; @@ -1868,7 +1868,7 @@ static LONG exception_filter(PEXCEPTION_POINTERS pExp) noexcept { const DWORD64 base = reinterpret_cast(info.lpBaseOfDll); - if (RIP(pExp->ContextRecord) >= base && RIP(pExp->ContextRecord) < base + info.SizeOfImage) + if (exec_addr >= base && exec_addr < base + info.SizeOfImage) { std::string module_name; for (DWORD size = 15; module_name.size() != size;)