Skip to content

Commit f4f5fda

Browse files
committed
[AddressLowering] Reserve capacity, don't resize.
Resizing a SmallVector of SILValues fills it with invalid SILValues. THe intent is to reserve space for forthcoming values.
1 parent 47a478d commit f4f5fda

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/SILOptimizer/Mandatory/AddressLowering.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1159,7 +1159,7 @@ void OpaqueStorageAllocation::allocatePhi(PhiValue phi) {
11591159
coalescedPhi.coalesce(phi, pass.valueStorageMap);
11601160

11611161
SmallVector<SILValue, 4> coalescedValues;
1162-
coalescedValues.resize(coalescedPhi.getCoalescedOperands().size());
1162+
coalescedValues.reserve(coalescedPhi.getCoalescedOperands().size());
11631163
for (SILValue value : coalescedPhi.getCoalescedValues())
11641164
coalescedValues.push_back(value);
11651165

0 commit comments

Comments
 (0)