[Mlir-commits] [mlir] [mlir] Fix use-after-free bugs in {RankedTensorType|VectorType}::Builder (PR #68969)
Benjamin Maxwell
llvmlistbot at llvm.org
Tue Oct 17 02:18:29 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 = {};
----------------
MacDue wrote:
Alternatively, if the COW features are still desired this pattern could be wrapped in a safer class (like `CopyOnWriteArrayRef<T>`) and that used in the builders instead.
https://github.com/llvm/llvm-project/pull/68969
More information about the Mlir-commits
mailing list