LibJS: Pad the capacity of BasicBlock while growing it

Just using Vector::resize() meant that we allocated exact capacity
instead of leaving padding at the end. This patch adds a call to
grow_capacity() before resize(), which ensures that we grow with the
usual extra padding.
This commit is contained in:
Andreas Kling 2023-09-30 09:33:11 +02:00
parent a0b939cef4
commit f388d2362a

View file

@ -43,6 +43,7 @@ void BasicBlock::dump(Bytecode::Executable const& executable) const
void BasicBlock::grow(size_t additional_size)
{
m_buffer.grow_capacity(m_buffer.size() + additional_size);
m_buffer.resize(m_buffer.size() + additional_size);
}