diff --git a/src/binary/mach-o.hpp b/src/binary/mach-o.hpp index 0631388..a872f18 100644 --- a/src/binary/mach-o.hpp +++ b/src/binary/mach-o.hpp @@ -426,7 +426,7 @@ namespace detail { // we have a bunch of symbols in our binary we need to pair up with symbols from various .o files // first collect symbols and the objects they come from std::vector symbols; - const auto& symtab_info_res = get_symtab_info(); + auto symtab_info_res = get_symtab_info(); if(!symtab_info_res) { return std::move(symtab_info_res).unwrap_error(); } diff --git a/src/utils/utils.hpp b/src/utils/utils.hpp index 38230fe..f4a04f2 100644 --- a/src/utils/utils.hpp +++ b/src/utils/utils.hpp @@ -337,8 +337,14 @@ namespace detail { enum class member { value, error }; member active; public: - Result(T value) : value_(std::move(value)), active(member::value) {} - Result(E error) : error_(std::move(error)), active(member::error) { + Result(T&& value) : value_(std::move(value)), active(member::value) {} + Result(E&& error) : error_(std::move(error)), active(member::error) { + if(!absorb_trace_exceptions.load()) { + std::fprintf(stderr, "%s\n", unwrap_error().what()); + } + } + Result(T& value) : value_(T(value)), active(member::value) {} + Result(E& error) : error_(E(error)), active(member::error) { if(!absorb_trace_exceptions.load()) { std::fprintf(stderr, "%s\n", unwrap_error().what()); }