Skip to content

Commit

Permalink
Merge pull request #4297 from Rohde-Schwarz/fix/msvc-debug-warnings
Browse files Browse the repository at this point in the history
Fix: MSVC Unreachable Code Debug Warnings
  • Loading branch information
FAlbertDev authored Aug 9, 2024
2 parents b227a5d + e99b928 commit d0f11a6
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
2 changes: 0 additions & 2 deletions src/lib/ffi/ffi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,6 @@ int ffi_guard_thunk(const char* func_name, const std::function<int()>& thunk) {
} catch(...) {
return ffi_error_exception_thrown(func_name, "unknown exception");
}

return BOTAN_FFI_ERROR_UNKNOWN_ERROR;
}

} // namespace Botan_FFI
Expand Down
8 changes: 4 additions & 4 deletions src/lib/tls/tls13/tls_handshake_state_13.h
Original file line number Diff line number Diff line change
Expand Up @@ -156,9 +156,9 @@ class BOTAN_TEST_API Handshake_State_13 : public Internal::Handshake_State_13_Ba
[&](auto msg) -> as_wrapped_references_t<Inbound_Message_T> {
if constexpr(std::is_constructible_v<Inbound_Message_T, decltype(msg)>) {
return std::reference_wrapper<decltype(msg)>(store(std::move(msg), true));
} else {
throw TLS_Exception(AlertType::UnexpectedMessage, "received an illegal handshake message");
}

throw TLS_Exception(AlertType::UnexpectedMessage, "received an illegal handshake message");
},
std::move(message));
}
Expand All @@ -168,9 +168,9 @@ class BOTAN_TEST_API Handshake_State_13 : public Internal::Handshake_State_13_Ba
[](auto msg) -> Inbound_Post_Handshake_Message_T {
if constexpr(std::is_constructible_v<Inbound_Post_Handshake_Message_T, decltype(msg)>) {
return msg;
} else {
throw TLS_Exception(AlertType::UnexpectedMessage, "received an unexpected post-handshake message");
}

throw TLS_Exception(AlertType::UnexpectedMessage, "received an unexpected post-handshake message");
},
std::move(message));
}
Expand Down
1 change: 0 additions & 1 deletion src/tests/test_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ class Utility_Function_Tests final : public Test {
results.push_back(test_loadstore_fallback());
results.push_back(test_loadstore_constexpr());
return Botan::concat(results, test_copy_out_be_le());
return results;
}

private:
Expand Down

0 comments on commit d0f11a6

Please sign in to comment.