[ox/preloader] Fix SizeCather::pad

This commit is contained in:
Gary Talent 2022-12-03 01:43:45 -06:00
parent 86c33019fe
commit 5bac497293

View File

@ -87,8 +87,11 @@ constexpr ox::Error SizeCatcher<PlatSpec>::field(const char*, const T **val, std
template<typename PlatSpec>
constexpr void SizeCatcher<PlatSpec>::pad(const auto *val) noexcept {
const auto padding = m_size - m_size % alignOf<PlatSpec>(*val);
m_size += padding;
const auto a = alignOf<PlatSpec>(*val);
const auto excess = m_size % a;
if (excess) {
m_size += a - excess;
}
}
template<typename PlatSpec, typename T>