diff --git a/Common/Serialize/Serializer.cpp b/Common/Serialize/Serializer.cpp index eee85133ab..868231d2d2 100644 --- a/Common/Serialize/Serializer.cpp +++ b/Common/Serialize/Serializer.cpp @@ -60,6 +60,8 @@ PointerWrapSection PointerWrap::Section(const char *title, int minVer, int ver) char marker[16] = {0}; int foundVersion = ver; + curTitle_ = title; + // This is strncpy because we rely on its weird non-null-terminating zero-filling truncation behaviour. // Can't replace it with the more sensible truncate_cpy because that would break savestates. strncpy(marker, title, sizeof(marker)); @@ -122,6 +124,8 @@ void PointerWrap::SetError(Error error_) { // For the rest of this run, do nothing, to avoid running off the end of memory or something, // and also not logspam like MEASURE will do in an error case. mode = PointerWrap::MODE_NOOP; + // Also, remember the bad section. + firstBadSectionTitle_ = curTitle_; } } diff --git a/Common/Serialize/Serializer.h b/Common/Serialize/Serializer.h index 15a1bcbe26..4c1b4c050b 100644 --- a/Common/Serialize/Serializer.h +++ b/Common/Serialize/Serializer.h @@ -160,6 +160,7 @@ public: private: const char *firstBadSectionTitle_ = nullptr; + const char *curTitle_; u8 *ptrStart_; std::vector checkpoints_; size_t curCheckpoint_ = 0;