Bug 550842. Ensure at least pointer compatible alignment of memory area for RuleProcessorData::operator new. r=bzbarsky

This commit is contained in:
Martin Husemann
2010-03-08 19:30:01 -05:00
parent 5abe82e32c
commit 114084df0f

View File

@@ -5174,7 +5174,7 @@ TryMatchingElementsInSubtree(nsINode* aRoot,
* cheaper than heap-allocating all the datas and keeping track of them all,
* and helps a good bit in the common cases. We also keep track of the whole
* parent data chain, since we have those Around anyway */
char databuf[2 * sizeof(RuleProcessorData)];
union { char c[2 * sizeof(RuleProcessorData)]; void *p; } databuf;
RuleProcessorData* prevSibling = nsnull;
RuleProcessorData* data = reinterpret_cast<RuleProcessorData*>(databuf);