mirror of
https://github.com/boostorg/stacktrace.git
synced 2026-02-22 15:42:32 +00:00
Fixed windows build and issue with returning incorrect frame address (now 0 retuned instead of running out of bounds)
This commit is contained in:
@@ -195,7 +195,7 @@ std::string backend::get_name(const void* addr) {
|
||||
}
|
||||
|
||||
const void* backend::get_address(std::size_t frame) const BOOST_NOEXCEPT {
|
||||
return data_->buffer[frame];
|
||||
return frame < data_->frames_count ? data_->buffer[frame] : 0;
|
||||
}
|
||||
|
||||
std::string backend::get_source_file(const void* addr) {
|
||||
|
||||
@@ -128,6 +128,7 @@ backend::backend(void* memory, std::size_t size, std::size_t& hash_code) BOOST_N
|
||||
}
|
||||
|
||||
std::string backend::get_name(const void* addr) {
|
||||
std::string result;
|
||||
com_holder<IDebugSymbols> idebug_;
|
||||
if (!try_init_com(idebug_)) {
|
||||
return result;
|
||||
@@ -166,10 +167,11 @@ std::string backend::get_name(const void* addr) {
|
||||
}
|
||||
|
||||
const void* backend::get_address(std::size_t frame) const BOOST_NOEXCEPT {
|
||||
return data_->buffer[frame];
|
||||
return frame < data_->frames_count ? data_->buffer[frame] : 0;
|
||||
}
|
||||
|
||||
std::string backend::get_source_file(const void* addr) {
|
||||
std::string result;
|
||||
com_holder<IDebugSymbols> idebug_;
|
||||
if (!try_init_com(idebug_)) {
|
||||
return result;
|
||||
|
||||
Reference in New Issue
Block a user