From f6af7c442df3e569492ced730e70d1bc72356c5e Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Sat, 15 May 2021 21:22:50 +0300 Subject: get rid of SafeInt --- src/call_stack.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/call_stack.cpp') 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 -#include - #include #include @@ -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); } -- cgit v1.3