diff --git a/hilti/runtime/src/types/bytes.cc b/hilti/runtime/src/types/bytes.cc index 75ea33a8df..10ad320566 100644 --- a/hilti/runtime/src/types/bytes.cc +++ b/hilti/runtime/src/types/bytes.cc @@ -215,6 +215,7 @@ Result Bytes::match(const RegExp& re, unsigned int group) const { } void Bytes::append(const stream::View& view) { + reserve(size() + view.size()); for ( auto block = view.firstBlock(); block; block = view.nextBlock(block) ) Base::append(reinterpret_cast(block->start), block->size); }