Bug 871444 - Round allocation size to keep required alignment. r=sstangl

This commit is contained in:
Martin Husemann 2013-06-11 12:23:24 -07:00
parent 783d0a1c40
commit bfaf87506a

View File

@ -158,6 +158,7 @@ public:
ParenthesesDisjunctionContext* allocParenthesesDisjunctionContext(ByteDisjunction* disjunction, unsigned* output, ByteTerm& term)
{
size_t size = sizeof(ParenthesesDisjunctionContext) - sizeof(unsigned) + (term.atom.parenthesesDisjunction->m_numSubpatterns << 1) * sizeof(unsigned) + sizeof(DisjunctionContext) - sizeof(uintptr_t) + disjunction->m_frameSize * sizeof(uintptr_t);
size = JS_ROUNDUP(size, JS_ALIGNMENT_OF(ParenthesesDisjunctionContext));
allocatorPool = allocatorPool->ensureCapacity(size);
if (!allocatorPool)
CRASH();