-
Type: Bug
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: Internal Code
-
None
-
Fully Compatible
-
ALL
-
Platforms E (01/08/16)
The following code assumes that the emptyBytes char array is suitably aligned to store an object of type DocumentStorage, but no alignment is enforced:
static const DocumentStorage& emptyDoc() { static const char emptyBytes[sizeof(DocumentStorage)] = {0}; return *reinterpret_cast<const DocumentStorage*>(emptyBytes); }
The code is also a strict aliasing violation.