From 7b04057e80a142d9d9068eafb5b35b1946390650 Mon Sep 17 00:00:00 2001 From: Exzap <13877693+Exzap@users.noreply.github.com> Date: Wed, 13 Dec 2023 17:48:53 +0100 Subject: [PATCH] Fix compile errors due to rebase --- .../HW/Espresso/Recompiler/IML/IMLRegisterAllocator.cpp | 2 +- src/util/helpers/StringBuf.h | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/Cafe/HW/Espresso/Recompiler/IML/IMLRegisterAllocator.cpp b/src/Cafe/HW/Espresso/Recompiler/IML/IMLRegisterAllocator.cpp index 2fb55c801..42fe619b2 100644 --- a/src/Cafe/HW/Espresso/Recompiler/IML/IMLRegisterAllocator.cpp +++ b/src/Cafe/HW/Espresso/Recompiler/IML/IMLRegisterAllocator.cpp @@ -1190,7 +1190,7 @@ void _IMLRA_checkAndTryExtendRange(IMLRegisterAllocatorContext& ctx, IMLSegment* { if (routeDepth >= 64) { - forceLogDebug_printf("Recompiler RA route maximum depth exceeded\n"); + cemuLog_logDebug(LogType::Force, "Recompiler RA route maximum depth exceeded\n"); return; } route[routeDepth] = currentSegment; diff --git a/src/util/helpers/StringBuf.h b/src/util/helpers/StringBuf.h index 8b34e54f7..6242fa4cd 100644 --- a/src/util/helpers/StringBuf.h +++ b/src/util/helpers/StringBuf.h @@ -44,11 +44,9 @@ class StringBuf void add(std::string_view appendedStr) { - if (this->length + appendedStr.size() + 1 >= this->limit) - _reserve(std::max(this->length + appendedStr.size() + 64, this->limit + this->limit / 2)); size_t copyLen = appendedStr.size(); - if (remainingLen < copyLen) - copyLen = remainingLen; + if (this->length + copyLen + 1 >= this->limit) + _reserve(std::max(this->length + copyLen + 64, this->limit + this->limit / 2)); char* outputStart = (char*)(this->str + this->length); std::copy(appendedStr.data(), appendedStr.data() + copyLen, outputStart); length += copyLen;