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:
parent
951c8f15d2
commit
15fdb838c7
@ -6875,7 +6875,8 @@ namespace pugi
|
|||||||
assert(!_root);
|
assert(!_root);
|
||||||
|
|
||||||
#ifdef PUGIXML_COMPACT
|
#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
|
#else
|
||||||
const size_t page_offset = 0;
|
const size_t page_offset = 0;
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user