From 9e52089a0187a6f1a807545fa206b61d08aab7c2 Mon Sep 17 00:00:00 2001 From: HJfod <60038575+HJfod@users.noreply.github.com> Date: Mon, 23 Jan 2023 19:51:51 +0200 Subject: [PATCH] whoops turns out union cast is required to make it work --- loader/include/Geode/utils/addresser.hpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/loader/include/Geode/utils/addresser.hpp b/loader/include/Geode/utils/addresser.hpp index f0025603..bf4ac936 100644 --- a/loader/include/Geode/utils/addresser.hpp +++ b/loader/include/Geode/utils/addresser.hpp @@ -10,6 +10,7 @@ #include #include #include +#include "../utils/casts.hpp" namespace geode::addresser { @@ -201,7 +202,7 @@ namespace geode::addresser { // do NOT delete the line below. // doing so breaks thunk adjusting on windows. // why? bruh idk - auto _ = *(ptrdiff_t*)(&func); + auto _ = *geode::cast::template union_cast(&func); return (F)((intptr_t)self + Addresser::thunkOf(func)); } @@ -210,7 +211,7 @@ namespace geode::addresser { // do NOT delete the line below. // doing so breaks thunk adjusting on windows. // why? bruh idk - auto _ = *(ptrdiff_t*)(&func); + auto _ = *geode::cast::template union_cast(&func); return (F)((intptr_t)self - Addresser::thunkOf(func)); } #endif