From 408eed65f8fc1581d0a43afc1b8dad2a96d65a11 Mon Sep 17 00:00:00 2001 From: Merry Date: Mon, 9 Oct 2023 22:03:39 +0100 Subject: [PATCH] oaknut: arm64_encode_helpers: remove unreachable code --- include/oaknut/impl/arm64_encode_helpers.inc.hpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/include/oaknut/impl/arm64_encode_helpers.inc.hpp b/include/oaknut/impl/arm64_encode_helpers.inc.hpp index 421db2f..130a30a 100644 --- a/include/oaknut/impl/arm64_encode_helpers.inc.hpp +++ b/include/oaknut/impl/arm64_encode_helpers.inc.hpp @@ -118,10 +118,10 @@ std::uint32_t encode(AddrOffset v) }; return std::visit(detail::overloaded{ - [&](std::uint32_t encoding) { + [&](std::uint32_t encoding) -> std::uint32_t { return pdep(encoding); }, - [&](Label* label) { + [&](Label* label) -> std::uint32_t { if (label->m_addr) { return encode_fn(Policy::current_address(), *label->m_addr); } @@ -129,12 +129,11 @@ std::uint32_t encode(AddrOffset v) label->m_wbs.emplace_back(Label::Writeback{Policy::current_address(), ~splat, static_cast(encode_fn)}); return 0u; }, - [&]([[maybe_unused]] const void* p) { + [&]([[maybe_unused]] const void* p) -> std::uint32_t { if constexpr (Policy::has_absolute_addresses) { return encode_fn(Policy::current_address(), reinterpret_cast(p)); } else { throw OaknutException{ExceptionType::RequiresAbsoluteAddressesContext}; - return 0u; } }, }, @@ -151,7 +150,7 @@ std::uint32_t encode(PageOffset v) }; return std::visit(detail::overloaded{ - [&](Label* label) { + [&](Label* label) -> std::uint32_t { if (label->m_addr) { return encode_fn(Policy::current_address(), *label->m_addr); } @@ -159,12 +158,11 @@ std::uint32_t encode(PageOffset v) label->m_wbs.emplace_back(Label::Writeback{Policy::current_address(), ~splat, static_cast(encode_fn)}); return 0u; }, - [&]([[maybe_unused]] const void* p) { + [&]([[maybe_unused]] const void* p) -> std::uint32_t { if constexpr (Policy::has_absolute_addresses) { return encode_fn(Policy::current_address(), reinterpret_cast(p)); } else { throw OaknutException{ExceptionType::RequiresAbsoluteAddressesContext}; - return 0u; } }, },