You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
debug_view_ = name; assumes that name is a string view of a string whose lifetime expands across frames. When a string_view of a temporary string object is passed in (and it is "equal" to one of the strings within the vector debug_views), the function silently fails, debug_view sooner become meaningless and ultimately causes random behavior.
I'll suggest a fix about changing debug_view_ = name; to debug_view_ = *debugView;
Also, auto debugView = std::find_if(debug_views_.cbegin(), debug_views_.cend(), [this](auto val) { return debug_view_ == val.first; }); seems to not be doing correct validation.
The text was updated successfully, but these errors were encountered:
Hineven
changed the title
setDebugView(const std::string_view &) fails to accept string views from non-persistent strings.
setDebugView(const std::string_view &) malfunctions.
Apr 19, 2024
at
capsaicin_internal.cpp: 665
:debug_view_ = name;
assumes thatname
is a string view of a string whose lifetime expands across frames. When astring_view
of a temporary string object is passed in (and it is "equal" to one of the strings within the vectordebug_views
), the function silently fails,debug_view
sooner become meaningless and ultimately causes random behavior.I'll suggest a fix about changing
debug_view_ = name;
todebug_view_ = *debugView;
Also,
auto debugView = std::find_if(debug_views_.cbegin(), debug_views_.cend(), [this](auto val) { return debug_view_ == val.first; });
seems to not be doing correct validation.The text was updated successfully, but these errors were encountered: