diff --git a/deps/ox/src/ox/model/descwrite.hpp b/deps/ox/src/ox/model/descwrite.hpp index 0ea3cb08..7ed0ddc4 100644 --- a/deps/ox/src/ox/model/descwrite.hpp +++ b/deps/ox/src/ox/model/descwrite.hpp @@ -363,8 +363,8 @@ constexpr Result buildTypeDef(TypeStore *typeStore) noexcept { oxReturnError(model(&handler, t)); a.deallocate(t, 1); } else { - T *t = reinterpret_cast(ox_alloca(sizeof(T))); - oxReturnError(model(&handler, t)); + auto t = ox_malloca(sizeof(T), T); + oxReturnError(model(&handler, t.get())); } return writer.definition(); }