[ox/model] Fix null ptr use when describing nested Vectors

This commit is contained in:
Gary Talent 2022-12-04 01:48:56 -06:00
parent 8e956c68b3
commit ea7ccf40b1

View File

@ -39,7 +39,7 @@ template<typename T, std::size_t sz>
constexpr int indirectionLevels_v<T[sz]> = 1 + indirectionLevels_v<T>;
template<typename T, std::size_t SmallVecSz>
constexpr int indirectionLevels_v<::ox::Vector<T, SmallVecSz>> = 1 + indirectionLevels_v<typename T::value_type>;
constexpr int indirectionLevels_v<::ox::Vector<T, SmallVecSz>> = 1 + indirectionLevels_v<T>;
template<typename T>
constexpr auto buildSubscriptStack(const T*, SubscriptStack*) noexcept {
@ -246,7 +246,7 @@ constexpr Error TypeDescWriter::fieldCString(CRStringView name, Args&&...) noexc
template<typename T>
constexpr const DescriptorType *TypeDescWriter::type(const T *val) const noexcept {
if constexpr(isVector_v<T>) {
return type(val->data());
return type(static_cast<typename T::value_type*>(nullptr));
} else {
auto [t, err] = m_typeStore->template get<T>();
if (!err) {