Fix xpointer constructor for null pointers.

This commit is contained in:
Skyth 2025-01-28 18:34:39 +03:00
parent 73b75e197a
commit 0fc545a6e2

View File

@ -105,7 +105,7 @@ struct xpointer
{
}
xpointer(T* ptr) : ptr(reinterpret_cast<size_t>(ptr) - reinterpret_cast<size_t>(MmGetHostAddress(0)))
xpointer(T* p) : ptr(p != nullptr ? (reinterpret_cast<size_t>(p) - reinterpret_cast<size_t>(MmGetHostAddress(0))) : 0)
{
}