Skip to content

Commit ddc132b

Browse files
committed
!fixup use to_vector to fix stack-use-after-free.
1 parent 69f32c9 commit ddc132b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3068,7 +3068,8 @@ InstructionCost VPReplicateRecipe::computeCost(ElementCount VF,
30683068
InstructionCost ScalarizationCost = 0;
30693069
if (VF.isVector()) {
30703070
if (!ResultTy->isVoidTy()) {
3071-
for (Type *VectorTy : getContainedTypes(toVectorizedTy(ResultTy, VF))) {
3071+
for (Type *VectorTy :
3072+
to_vector(getContainedTypes(toVectorizedTy(ResultTy, VF)))) {
30723073
ScalarizationCost += Ctx.TTI.getScalarizationOverhead(
30733074
cast<VectorType>(VectorTy), APInt::getAllOnes(VF.getFixedValue()),
30743075
/*Insert=*/true,

0 commit comments

Comments
 (0)