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
|
||||
/// values must not fold away when tiling. Otherwise, use a more robust
|
||||
/// `tileSizeComputationFunction`.
|
||||
LinalgTilingOptions &setTileSizes(ValueRange ts) {
|
||||
tileSizeComputationFunction = [&](OpBuilder &, Operation *) {
|
||||
return SmallVector<Value, 4>(ts.begin(), ts.end());
|
||||
LinalgTilingOptions &setTileSizes(SmallVector<Value, 4> ts) {
|
||||
tileSizeComputationFunction = [=](OpBuilder &, Operation *) {
|
||||
return ts;
|
||||
};
|
||||
return *this;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue