[Mlir-commits] [mlir] [mlir] Fix use-after-free bugs in {RankedTensorType|VectorType}::Builder (PR #68969)

Mehdi Amini llvmlistbot at llvm.org
Mon Oct 16 01:04:42 PDT 2023


================
@@ -277,7 +277,7 @@ class RankedTensorType::Builder {
     if (storage.empty())
       storage.append(shape.begin(), shape.end());
     storage.erase(storage.begin() + pos);
-    shape = {storage.data(), storage.size()};
+    shape = {};
----------------
joker-eph wrote:

The comment here is saying that you can maintain integrity by pointing to the new storage here instead of clearing the shape and detecting this in the getter.

https://github.com/llvm/llvm-project/pull/68969


More information about the Mlir-commits mailing list