From f8cc4616352bc3216aefd487c52d0ec62f57423e Mon Sep 17 00:00:00 2001 From: mat <26722564+matcool@users.noreply.github.com> Date: Mon, 25 Dec 2023 00:52:43 -0300 Subject: [PATCH] fix android gd::string --- loader/src/platform/android/gdstdlib.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/loader/src/platform/android/gdstdlib.cpp b/loader/src/platform/android/gdstdlib.cpp index 1236df57..8c44f3d2 100644 --- a/loader/src/platform/android/gdstdlib.cpp +++ b/loader/src/platform/android/gdstdlib.cpp @@ -7,7 +7,7 @@ static constexpr ptrdiff_t MENULAYER_SCENE = 0x309068 - 0x10000; static constexpr ptrdiff_t STRING_EMPTY = 0xaa1c3c - 0x10000; -static constexpr ptrdiff_t OPERATOR_DELETE = 0x72033c - 0x10000 + 1; +static constexpr ptrdiff_t OPERATOR_DELETE = 0x7514c8 - 0x10000 + 1; static constexpr ptrdiff_t STRING_COPY = 0x753a44 - 0x10000 + 1; #elif defined(GEODE_IS_ANDROID64) @@ -44,7 +44,11 @@ namespace geode::stl { void StringImpl::free() { if (data.m_data == nullptr || data.m_data == emptyInternalString()) return; // TODO: reimplement this + #ifdef GEODE_IS_ANDROID32 + reinterpret_cast(geode::base::get() + OPERATOR_DELETE)(&data); + #else reinterpret_cast(geode::base::get() + OPERATOR_DELETE)(&data.m_data[-1]); + #endif } char* StringImpl::getStorage() {