summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/pugixml.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/pugixml.cpp b/src/pugixml.cpp
index ef9400f..e5fd4b2 100644
--- a/src/pugixml.cpp
+++ b/src/pugixml.cpp
@@ -667,6 +667,8 @@ PUGI__NS_BEGIN
public:
compact_header(xml_memory_page* page, unsigned int flags)
{
+ PUGI__STATIC_ASSERT(sizeof(xml_memory_page) + xml_memory_page_size <= (1 << (16 + compact_alignment_log2)));
+
ptrdiff_t page_offset = (reinterpret_cast<char*>(this) - reinterpret_cast<char*>(page)) >> compact_alignment_log2;
assert(page_offset >= 0 && page_offset < (1 << 16));