[flang-commits] [flang] [flang][OpenMP] Fix use-after-free in OMPFunctionFiltering (PR #84373)

Sergio Afonso via flang-commits flang-commits at lists.llvm.org
Fri Mar 8 04:03:55 PST 2024


skatrak wrote:

Thank you for noticing this issue. I think we can simplify the fix a bit, though. The docs for [`Operation::walk()`](https://github.com/ROCm/llvm-project/blob/ff56af53349912141a0b19feda51c448bc09613a/mlir/include/mlir/IR/Operation.h#L767) state that the callback is allowed to erase that operation when walking in pre-order if it is skipped after the erasure. It seems simpler and cheaper to just `return WalkResult::skip()` at that point rather than constructing a list to be deleted later.

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


More information about the flang-commits mailing list