This is an archive of the discontinued LLVM Phabricator instance.

[mlir] Check for type conversion success in std->llvm function conversion
ClosedPublic

Authored by ftynse on Sep 3 2020, 1:05 AM.

Details

Summary

Type converter may fail and return nullptr on unconvertible types. The function
conversion did not include a check and was attempting to use a nullptr type to
construct an LLVM function, leading to a crash. Add a check and return early.
The rest of the call stack propagates errors properly.

Fixes PR47403.

Diff Detail

Event Timeline

ftynse created this revision.Sep 3 2020, 1:05 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 3 2020, 1:05 AM
ftynse requested review of this revision.Sep 3 2020, 1:05 AM
mehdi_amini accepted this revision.Sep 13 2020, 9:40 PM
This revision is now accepted and ready to land.Sep 13 2020, 9:40 PM