[mlir] verify against nullptr payload in transform dialect
authorAlex Zinenko <zinenko@google.com>
Mon, 9 Jan 2023 13:01:25 +0000 (14:01 +0100)
committerAlex Zinenko <zinenko@google.com>
Mon, 9 Jan 2023 13:03:35 +0000 (14:03 +0100)
commit984c2c8cb343e9a9d43b085f27f2f2ac3253cae7
tree1dacaea33a37b451db87ba9d8b4f71a01e36a882
parent499bf67208d982948e2580b56a09944a285fee76
[mlir] verify against nullptr payload in transform dialect

When establishing the correspondence between transform values and
payload operations or parameters, check that the latter are non-null and
report errors. This was previously allowed for exotic cases of partially
successfull transformations with "apply each" trait, but was dangerous.
The "apply each" implementation was reworked to remove the need for this
functionality, so this can now be hardned to avoid null pointer
dereferences.

Reviewed By: nicolasvasilache

Differential Revision: https://reviews.llvm.org/D141142
mlir/include/mlir/Dialect/Transform/IR/TransformInterfaces.h
mlir/lib/Dialect/Transform/IR/TransformInterfaces.cpp
mlir/test/Dialect/Transform/test-interpreter.mlir
mlir/test/lib/Dialect/Transform/TestTransformDialectExtension.cpp
mlir/test/lib/Dialect/Transform/TestTransformDialectExtension.td