ubsan: Fix type mismatch in compact mode for document data

We were misaligning document data on 64-bit platforms by placing 8b
pointers at 4b offsets; fix this by reserving a full pointer worth of
bytes for page marker.
This commit is contained in:
Arseny Kapoulkine 2018-03-15 22:56:28 -07:00
parent 951c8f15d2
commit 15fdb838c7

View file

@ -6875,7 +6875,8 @@ namespace pugi
assert(!_root);
#ifdef PUGIXML_COMPACT
const size_t page_offset = sizeof(uint32_t);
// space for page marker for the first page (uint32_t), rounded up to pointer size; assumes pointers are at least 32-bit
const size_t page_offset = sizeof(void*);
#else
const size_t page_offset = 0;
#endif