diff options
| author | Egor Tensin <Egor.Tensin@gmail.com> | 2021-05-15 21:22:50 +0300 |
|---|---|---|
| committer | Egor Tensin <Egor.Tensin@gmail.com> | 2021-05-15 21:22:50 +0300 |
| commit | f6af7c442df3e569492ced730e70d1bc72356c5e (patch) | |
| tree | bd18c18acbc131bd43de99c9f03f698eff479a82 /src/call_stack.cpp | |
| parent | workflows/ci: build using VS 2015 also (diff) | |
| download | winapi-debug-f6af7c442df3e569492ced730e70d1bc72356c5e.tar.gz winapi-debug-f6af7c442df3e569492ced730e70d1bc72356c5e.zip | |
get rid of SafeInt
Diffstat (limited to '')
| -rw-r--r-- | src/call_stack.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/call_stack.cpp b/src/call_stack.cpp index aec50de..183f14a 100644 --- a/src/call_stack.cpp +++ b/src/call_stack.cpp @@ -5,8 +5,6 @@ #include <pdb/all.hpp> -#include <SafeInt.hpp> - #include <windows.h> #include <algorithm> @@ -41,8 +39,9 @@ std::string offset_from(const std::string& thing, Address offset) { std::string offset_from_module(const ModuleInfo& module, Address addr) { Address offset = 0; - if (!SafeSubtract(addr, module.get_offline_base(), offset)) + if (addr < module.get_offline_base()) throw std::range_error{"invalid address in module"}; + offset = addr - module.get_offline_base(); return offset_from(module.get_name(), offset); } |
