Fix ensureTotalCapacity calls that should be ensureUnusedCapacity calls
If these functions are called more than once, then the array list would no longer be guaranteed to have enough capacity during the appendAssumeCapacity calls. With ensureUnusedCapacity, they will always be guaranteed to have enough capacity regardless of how many times the function is called.
This commit is contained in:
committed by
Andrew Kelley
parent
77eefebe65
commit
70ef9bc75c
@@ -629,7 +629,7 @@ pub const DeclGen = struct {
|
||||
const params = decl.ty.fnParamLen();
|
||||
var i: usize = 0;
|
||||
|
||||
try self.args.ensureTotalCapacity(params);
|
||||
try self.args.ensureUnusedCapacity(params);
|
||||
while (i < params) : (i += 1) {
|
||||
const param_type_id = self.spv.types.get(decl.ty.fnParamType(i)).?;
|
||||
const arg_result_id = self.spv.allocResultId();
|
||||
|
||||
Reference in New Issue
Block a user