aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/dbghelp.cpp
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2020-01-14 22:36:20 +0300
committerEgor Tensin <Egor.Tensin@gmail.com>2020-01-14 22:38:00 +0300
commiteac7246943bfaabdafcff7506d479f4cbe1ff0cc (patch)
treed7345a17e10f6b162923bdb89b31dc2298d87d3f /src/dbghelp.cpp
parentadd SafeInt as a submodule (diff)
downloadwinapi-debug-eac7246943bfaabdafcff7506d479f4cbe1ff0cc.tar.gz
winapi-debug-eac7246943bfaabdafcff7506d479f4cbe1ff0cc.zip
fix SafeInt usage
Diffstat (limited to 'src/dbghelp.cpp')
-rw-r--r--src/dbghelp.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/dbghelp.cpp b/src/dbghelp.cpp
index 40c2ba5..af8d64d 100644
--- a/src/dbghelp.cpp
+++ b/src/dbghelp.cpp
@@ -5,8 +5,9 @@
#include "pdb/all.hpp"
+#include <SafeInt.hpp>
+
#include <Windows.h>
-#include <safeint.h>
#pragma warning(push, 0)
#include <DbgHelp.h>
#pragma warning(pop, 0)
@@ -39,7 +40,6 @@ Address next_offline_base = 0x10000000;
Address gen_next_offline_base(std::size_t pdb_size) {
const auto base = next_offline_base;
- using msl::utilities::SafeAdd;
if (!SafeAdd(next_offline_base, pdb_size, next_offline_base))
throw std::runtime_error{
"no more PDB files can be added, the internal address space is exhausted"};
@@ -75,7 +75,7 @@ void DbgHelp::close() {
ModuleInfo DbgHelp::load_pdb(const std::string& path) const {
DWORD size = 0;
- if (!msl::utilities::SafeCast(file::get_size(path), size))
+ if (!SafeCast(file::get_size(path), size))
throw std::range_error{"PDB file is too large"};
const auto offline_base =