forked from OSchip/llvm-project
[mlir][Linalg] Fix ASAN bug
```
LinalgTilingOptions &setTileSizes(ValueRange ts)
```
makes it all too easy to create stack-use-after-return errors.
In particular, c694588fc5
introduced one such issue.
Instead just take a copy in the lambda and be done with it.
This commit is contained in:
parent
69acdfe075
commit
a81b938b6d
|
@ -326,9 +326,9 @@ struct LinalgTilingOptions {
|
||||||
/// Set the `tileSizeComputationFunction` to return the values `ts`. The
|
/// Set the `tileSizeComputationFunction` to return the values `ts`. The
|
||||||
/// values must not fold away when tiling. Otherwise, use a more robust
|
/// values must not fold away when tiling. Otherwise, use a more robust
|
||||||
/// `tileSizeComputationFunction`.
|
/// `tileSizeComputationFunction`.
|
||||||
LinalgTilingOptions &setTileSizes(ValueRange ts) {
|
LinalgTilingOptions &setTileSizes(SmallVector<Value, 4> ts) {
|
||||||
tileSizeComputationFunction = [&](OpBuilder &, Operation *) {
|
tileSizeComputationFunction = [=](OpBuilder &, Operation *) {
|
||||||
return SmallVector<Value, 4>(ts.begin(), ts.end());
|
return ts;
|
||||||
};
|
};
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue