Compare commits

..

2 Commits

Author SHA1 Message Date
6b948ee069 Merge commit '932c3e57e93d63dc98c454015afea941416ff423'
All checks were successful
Build / build (push) Successful in 2m8s
2023-12-29 18:44:06 -06:00
72dddcaee5 [ox] Fix TypeDescWriter segfault 2023-12-29 18:42:59 -06:00
2 changed files with 6 additions and 2 deletions

View File

@ -219,9 +219,11 @@ template<typename T>
constexpr Error TypeDescWriter::field(CRStringView name, const T *val) noexcept {
if (m_type) {
if constexpr(isVector_v<T> || isArray_v<T>) {
return field(name, val->data(), 0, detail::buildSubscriptStack(val));
typename T::value_type *data = nullptr;
return field(name, data, 0, detail::buildSubscriptStack(val));
} else if constexpr(isSmartPtr_v<T>) {
return field(name, val->get(), 0, detail::buildSubscriptStack(val));
typename T::value_type *data = nullptr;
return field(name, data, 0, detail::buildSubscriptStack(val));
} else if constexpr(is_pointer_v<T>) {
return field(name, val, 0, detail::buildSubscriptStack(val));
} else {

View File

@ -74,6 +74,7 @@ class SharedPtr {
int *m_refCnt = nullptr;
public:
using value_type = T;
explicit constexpr SharedPtr(T *t = nullptr) noexcept: m_t(t), m_refCnt(new int) {
}
@ -183,6 +184,7 @@ class UniquePtr {
T *m_t = nullptr;
public:
using value_type = T;
explicit constexpr UniquePtr(T *t = nullptr) noexcept: m_t(t) {
}