LLVM Builder: Pass correct argument to ensureUnusedMetadataCapacity

The trail_len was being multiplied by the size of the type before
This commit is contained in:
antlilja 2024-07-03 18:06:53 +02:00 committed by Jacob Young
parent 4870e002f2
commit efb00c20ee

View File

@ -12007,7 +12007,7 @@ pub fn debugExpression(
self: *Builder,
elements: []const u32,
) Allocator.Error!Metadata {
try self.ensureUnusedMetadataCapacity(1, Metadata.Expression, elements.len * @sizeOf(u32));
try self.ensureUnusedMetadataCapacity(1, Metadata.Expression, elements.len);
return self.debugExpressionAssumeCapacity(elements);
}
@ -12015,7 +12015,7 @@ pub fn debugTuple(
self: *Builder,
elements: []const Metadata,
) Allocator.Error!Metadata {
try self.ensureUnusedMetadataCapacity(1, Metadata.Tuple, elements.len * @sizeOf(Metadata));
try self.ensureUnusedMetadataCapacity(1, Metadata.Tuple, elements.len);
return self.debugTupleAssumeCapacity(elements);
}