In release build without symbols and frame pointers, _Unwind_Backtrace can be a no-op, not invoking the callback even a single time.
This then keeps the _index at -1, so after casting into size_t and attempting to allocate vector with that size, app crashes (vector::resize to MAX_UINT does not work 😛 ).
The issue didn't happen when using the backtrace backends - it correctly returns the empty stack trace in that case.
This patch ensures the same behavior also when using unwind.
In release build without symbols and frame pointers,
_Unwind_Backtrace
can be a no-op, not invoking the callback even a single time.This then keeps the
_index
at-1
, so after casting intosize_t
and attempting to allocate vector with that size, app crashes (vector::resize to MAX_UINT does not work 😛 ).The issue didn't happen when using the
backtrace
backends - it correctly returns the empty stack trace in that case.This patch ensures the same behavior also when using
unwind
.