Player: Windows Debug assertion failures

Created on 11 Jan 2020  路  3Comments  路  Source: EasyRPG/Player

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.

Crash Patch available Win32

All 3 comments

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)
Was this page helpful?
0 / 5 - 0 ratings

Related issues

zell180 picture zell180  路  23Comments

akien-mga picture akien-mga  路  15Comments

Klauserus picture Klauserus  路  16Comments

fmatthew5876 picture fmatthew5876  路  12Comments

hellow554 picture hellow554  路  14Comments