Fixed windows build and issue with returning incorrect frame address (now 0 retuned instead of running out of bounds)

This commit is contained in:
Antony Polukhin
2016-11-25 22:12:57 +03:00
parent aff892356f
commit d4f8f64929
2 changed files with 4 additions and 2 deletions

View File

@@ -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) {

View File

@@ -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;