From 816b3930a712ec0f11dcc2a9c91047025592078c Mon Sep 17 00:00:00 2001 From: gentlegiantJGC Date: Tue, 17 Sep 2024 13:10:11 +0100 Subject: [PATCH] Convert runtime error to unreachable --- src/amulet_nbt/cpp/nbt_encoding/string/read_string.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/amulet_nbt/cpp/nbt_encoding/string/read_string.cpp b/src/amulet_nbt/cpp/nbt_encoding/string/read_string.cpp index 87b31ebe..644f2f93 100644 --- a/src/amulet_nbt/cpp/nbt_encoding/string/read_string.cpp +++ b/src/amulet_nbt/cpp/nbt_encoding/string/read_string.cpp @@ -421,7 +421,11 @@ AmuletNBT::TagNode _read_snbt(const AmuletNBT::CodePointVector& snbt, size_t& in return AmuletNBT::write_utf8(string); } } - throw std::runtime_error("Should have returned before now."); +#if defined(_MSC_VER) && !defined(__clang__) // MSVC + __assume(false); +#else // GCC, Clang + __builtin_unreachable(); +#endif }