Serialize: Report the first bad section, and start with no title

SetError overwrote the first bad section with whichever section a later
error came from, and an error before any section read an uninitialized
curTitle_.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
This commit is contained in:
Henrik RydgårdandClaude Opus 5.5 committed 2026-09-28 09:34:06 -06:00
1 parent 11e30e9456
commit 9140bc9548
2 files changed
+4 -2

No files matched your search

+3 -1
View File
@@ -125,7 +125,9 @@ void PointerWrap::SetError(Error error_) {
// and also not logspam like MEASURE will do in an error case.
mode = PointerWrap::MODE_NOOP;
// Also, remember the bad section.
firstBadSectionTitle_ = curTitle_;
if (!firstBadSectionTitle_) {
firstBadSectionTitle_ = curTitle_;
}
}
}
+1 -1
View File
@@ -182,7 +182,7 @@ public:
private:
const char *firstBadSectionTitle_ = nullptr;
const char *curTitle_;
const char *curTitle_ = nullptr;
u8 *ptrStart_;
u8 *end_ = nullptr;
std::vector<SerializeCheckpoint> checkpoints_;