Commit fbb0c8d639
Changed files (1)
std
std/coff.zig
@@ -142,10 +142,11 @@ pub const Coff = struct {
}
pub fn loadSections(self: *Coff) !void {
- if (self.sections.len != 0)
+ if (self.sections.len == self.coff_header.number_of_sections)
return;
self.sections = ArrayList(Section).init(self.allocator);
+ try self.sections.ensureCapacity(self.coff_header.number_of_sections);
var file_stream = self.in_file.inStream();
const in = &file_stream.stream;