This is an archive of the discontinued LLVM Phabricator instance.

Fix crash in MLIR opaque attribute parser
ClosedPublic

Authored by mehdi_amini on Jan 19 2022, 11:51 AM.

Details

Summary

An assertion is triggered with the dialect is malformed.

Diff Detail

Event Timeline

mehdi_amini created this revision.Jan 19 2022, 11:51 AM
mehdi_amini requested review of this revision.Jan 19 2022, 11:51 AM
rriddle added inline comments.Jan 19 2022, 11:52 AM
mlir/lib/Parser/AttributeParser.cpp
844

Accident?

863

Would the crash be fixed by using getChecked here?

Remove spurious change

Don't use stringref, the API returns a string

mehdi_amini added inline comments.Jan 19 2022, 12:40 PM
mlir/lib/Parser/AttributeParser.cpp
863

Yes, but the error would be: elements literal must be a ranked tensor or vector type instead of invalid dialect namespace 'string with space'

mehdi_amini added inline comments.Jan 19 2022, 12:42 PM
mlir/lib/Parser/AttributeParser.cpp
863

Scratch that, it just works :)
Updated!

Use getChecked

mehdi_amini marked 2 inline comments as done.Jan 19 2022, 12:42 PM
This revision is now accepted and ready to land.Jan 19 2022, 12:48 PM
This revision was automatically updated to reflect the committed changes.