diff options
author | Ashay Rane <ashay@users.noreply.github.com> | 2023-01-17 10:55:02 -0800 |
---|---|---|
committer | Stella Stamenova <stilis@microsoft.com> | 2023-01-17 10:56:06 -0800 |
commit | d23516e9ad477527a9db4d06b1fa9566680ac67c (patch) | |
tree | a989431b84692e64ec7b8df9f35a63865622f567 /llvm/unittests/ADT/ArrayRefTest.cpp | |
parent | eec516a0954a5a91490ac4b6e86196e9813d9185 (diff) | |
download | llvm-d23516e9ad477527a9db4d06b1fa9566680ac67c.zip llvm-d23516e9ad477527a9db4d06b1fa9566680ac67c.tar.gz llvm-d23516e9ad477527a9db4d06b1fa9566680ac67c.tar.bz2 |
[mlir] fix dereferencing of optional sym_name attribute
`sym_name` is an optional attribute of `ModuleOp`, so it is unsafe to
fetch the underlying value without checking whether it is non-empty.
Such unsafe dereferencing causes the lower-host-to-llvm-calls_fail.mlir
test to segfault. Although this bug existed for four months, it wasn't
triggered, since previous tests executed a code path that used a default
value instead of one fetched from the module attribute.
This patch makes the code use a default value if the optional attribute
does not have a value.
Reviewed By: stella.stamenova
Differential Revision: https://reviews.llvm.org/D141941
Diffstat (limited to 'llvm/unittests/ADT/ArrayRefTest.cpp')
0 files changed, 0 insertions, 0 deletions