In the messages code there are many instances of &*text.end() to get a pointer to the end of the string. This works fine normally, but trips a debug exception in windows debug builds.
ah, the nice debug iterators. :+1:
Considering that end()-deref is undefined behaviour I wonder why UBSan isn't catching this :thinking:
Added fixes for these to #2026
Another assert:
player.cpp
escape_symbol = ReaderUtil::Recode("\\", enc);
escape_char = Utils::DecodeUTF32(Player::escape_symbol).front(); <-- This line
if (escape_symbol.empty()) {
// Bad encoding
Output::Debug("Bad encoding: %s. Trying next.", enc.c_str());
continue;
}
<-- Must be moved after the if (the front() triggers an assert on empty strings)