https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122674
Bug ID: 122674
Summary: Consider making std::basic_stacktrace memory safe
Product: gcc
Version: 16.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: libstdc++
Assignee: unassigned at gcc dot gnu.org
Reporter: redi at gcc dot gnu.org
Target Milestone: ---
If we always stored one default-initialized object of type
std::stacktrace_entry as a (static?) member of std::basic_stacktrace then we
could return an iterator/reference to that object for out-of-bounds calls to
operator[]
We could also make the basic_stacktrace::iterator store a pointer back to its
parent basic_stacktrace and check the bounds, so that incrementing past the end
(or before begin) would be a no-op.