Skip to content

Commit

Permalink
Convert runtime error to unreachable
Browse files Browse the repository at this point in the history
  • Loading branch information
gentlegiantJGC committed Sep 17, 2024
1 parent c580f57 commit 816b393
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/amulet_nbt/cpp/nbt_encoding/string/read_string.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
}


Expand Down

0 comments on commit 816b393

Please sign in to comment.