diff --git a/deps/ox/src/ox/std/anyptr.hpp b/deps/ox/src/ox/std/anyptr.hpp index c6611318..ac11e484 100644 --- a/deps/ox/src/ox/std/anyptr.hpp +++ b/deps/ox/src/ox/std/anyptr.hpp @@ -1,7 +1,9 @@ #pragma once +#include "assert.hpp" #include "array.hpp" +#include "def.hpp" #include "span.hpp" namespace ox { @@ -20,6 +22,7 @@ class AnyPtr { constexpr Wrap(T *pData) noexcept: data(pData) { } constexpr WrapBase *copyTo(ox::Span s) noexcept override { + oxAssert(s.size() >= sizeof(Wrap), "too small buffer"); if (std::is_constant_evaluated()) { return new Wrap(data); } else {