From 4b87f92ed0b2ea20df17c770f692791d90d14a72 Mon Sep 17 00:00:00 2001 From: rtldg Date: Sun, 2 Mar 2025 03:20:46 +0000 Subject: [PATCH] Modify because destructors do cause it to use mem --- core/sourcehook/sourcehook_hookmangen_x86_64.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/core/sourcehook/sourcehook_hookmangen_x86_64.cpp b/core/sourcehook/sourcehook_hookmangen_x86_64.cpp index 3a12379..5f212d0 100644 --- a/core/sourcehook/sourcehook_hookmangen_x86_64.cpp +++ b/core/sourcehook/sourcehook_hookmangen_x86_64.cpp @@ -1303,7 +1303,19 @@ static_assert(false, "Missing registers saving for linux"); // // // Result: we cannot detect if it should be register or memory without knowing the layout of the object. - return false; + // + // + // It doesn't seem like constructors or copy-constructors matter much. + + if ((pi.flags & PassInfo::PassFlag_ODtor) != 0) + { + pi.flags |= PassInfo::PassFlag_RetMem; + return true; + } + else + { + return false; + } #endif } }