[Mlir-commits] [mlir] [mlir][sparse] fix stack UAF (PR #79353)

Peiming Liu llvmlistbot at llvm.org
Wed Jan 24 12:07:56 PST 2024


https://github.com/PeimingLiu created https://github.com/llvm/llvm-project/pull/79353

None

>From 911650ea1de3c18261867b21264753515ab2bf70 Mon Sep 17 00:00:00 2001
From: Peiming Liu <peiming at google.com>
Date: Wed, 24 Jan 2024 20:07:05 +0000
Subject: [PATCH] [mlir][sparse] fix stack UAF

---
 .../SparseTensor/Transforms/Utils/SparseTensorLevel.cpp        | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/mlir/lib/Dialect/SparseTensor/Transforms/Utils/SparseTensorLevel.cpp b/mlir/lib/Dialect/SparseTensor/Transforms/Utils/SparseTensorLevel.cpp
index 22e65be8782fb4e..226cccbc422b9b6 100644
--- a/mlir/lib/Dialect/SparseTensor/Transforms/Utils/SparseTensorLevel.cpp
+++ b/mlir/lib/Dialect/SparseTensor/Transforms/Utils/SparseTensorLevel.cpp
@@ -862,14 +862,13 @@ ValueRange FilterIterator::forward(OpBuilder &b, Location l) {
 
   SmallVector<Value> whileArgs(getItVals().begin(), getItVals().end());
   whileArgs.push_back(isFirst);
-
   auto whileOp = b.create<scf::WhileOp>(
       l, ValueRange(whileArgs).getTypes(), whileArgs,
       /*beforeBuilder=*/
       [this](OpBuilder &b, Location l, ValueRange ivs) {
         ValueRange isFirst = linkNewScope(ivs);
         assert(isFirst.size() == 1);
-        ValueRange cont =
+        scf::ValueVector cont =
             genWhenInBound(b, l, *wrap, C_FALSE,
                            [this, isFirst](OpBuilder &b, Location l,
                                            Value wrapCrd) -> scf::ValueVector {



More information about the Mlir-commits mailing list